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:
def getIndex(char):
	d={"abc": 2,"def":3,"ghi":4,"jkl":5, "mno":6,"pqrs":7,"tuv":8,"wxyz":9}
	for key,value in d.items():
		if char in key:
			return value

t=input()
while t>0:
	t-=1
	output=''
	text=raw_input()
	for char in text:
		index=getIndex(char)
		output+=str(index)
	print output