POLYBIUS - Polybius square

For given text, encipher it with Polybius square and print.

Input

The first line of the standard input contains one integer t (t<10001) which is the number of test cases.

In each of the next t lines there is a string n (could contain spaces, which you dont have to encipher; apart from spaces it will be only made of big letters - 'A' to 'Z').

Output

For each test, print ciphered string n.

Score

Score is source length.

Example

Input:
4
SHORTENING IS FUNNY
NO IT ISNT
TRY IT AND ASCERTAIN
JI JI
Output: 43 23 34 42 44 15 33 24 33 22 24 43 21 45 33 33 54
33 34 24 44 24 43 33 44
44 42 54 24 44 11 33 14 11 43 13 15 42 44 11 24 33
24 24 24 24


Added by:Piotr Ką…kol
Date:2010-01-11
Time limit:0.439s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS OBJC SCM qobi VB.NET
Resource:POLYBIUS

hide comments
2015-08-25 15:12:34 Alex
How is it supposed to work?
all inputs -> all outputs
or input -> output -> input -> ...
For me both didn't work.
2013-07-08 15:55:59 orange
nice problem !!another cryp please!!
2011-04-26 13:57:36 anonymous
... I'm hereby officialy stupid. Don't know why I didn't notice that :) Thanks.
2011-04-26 09:50:37 Piotr KÄ…kol
@yxcv - Not for all - check all letters. There's not much of them.
2011-04-25 19:06:57 anonymous
#5011900 - Why WA? It works for any input here.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.