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:
#!/usr/bin/python
import sys
def main():
 for t in range(input()):
  s=raw_input()
  for i in range(len(s)):
   ch=s[i]
   if ch=='a' or ch=='b' or ch=='c':
    sys.stdout.write("2")
    continue
   elif ch=='d' or ch=='e' or ch=='f':
    sys.stdout.write("3")
    continue
   elif ch=='g' or ch=='h' or ch=='i':
    sys.stdout.write("4")
    continue
   elif ch=='j' or ch=='k' or ch=='l':
    sys.stdout.write("5")
    continue
   elif ch=='m' or ch=='n' or ch=='o':
    sys.stdout.write("6")
    continue
   elif ch=='p' or ch=='q' or ch=='r' or ch=='s':
    sys.stdout.write("7")
    continue
   elif ch=='t' or ch=='u' or ch=='v':
    sys.stdout.write("8")
    continue
   elif ch=='w' or ch=='x' or ch=='y' or ch=='z':
    sys.stdout.write("9")
    continue
  print 
main()