Problem: Solve The Mystery

Input:
First line contains T - number of test cases.
Following T lines each contains a string of characters in the range [a-z] only  

Output:
Print a numeric string for each test case.  

Constraints:
1 ≤ T ≤ 100
1 ≤ Length of String ≤ 100  

SAMPLE INPUT
10
key
to
control
nine
tails
is
in
your
hand
phone

SAMPLE OUTPUT
539
86
2668765
6463
82457
47
46
9687
4263
74663

Solution (in PYTHON):

Solution:
t=int(raw_input())
for W in range(t):
    s=raw_input()
    A=list(s)
    i=0
    while i<len(A):
       if A[i]=='a' or A[i]=='b' or A[i]=='c':
           A[i]='2'
       elif A[i]=='d' or A[i]=='e' or A[i]=='f':
           A[i]='3'
           
       elif A[i]=='g' or A[i]=='h' or A[i]=='i':
           A[i]='4'
       elif A[i]=='j' or A[i]=='k' or A[i]=='l':
           A[i]='5'
       elif A[i]=='m' or A[i]=='n' or A[i]=='o':
           A[i]='6'
       elif A[i]=='p' or A[i]=='q' or A[i]=='r' or A[i]=='s':
           A[i]='7'
       elif A[i]=='t' or A[i]=='u' or A[i]=='v':
           A[i]='8'
       elif A[i]=='x' or A[i]=='y' or A[i]=='z'  or A[i]=='w':
           A[i]='9'
       i=i+1    
    z=''.join(A)
    print(z)