'''
You are given a string S of alphabet characters and the task is to find its matching decimal representation as on the shown keypad. Output the decimal representation corresponding to the string. For ex: if you are given “amazon” then its corresponding decimal representation will be 262966.



Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a single line containing a string.

Output:
For each test case, print in a new line, the corresponding decimal representation of the given string.

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

Example:
Input:
2
geeksforgeeks
geeksquiz
Output:
4335736743357
433577849

Explanation:
Testcase 1: In geekforgeeks , decimal representation for g is 4 , e is 3 , k is 5 , s is 7 and so on . Hence the output for given input will be 4335736743357.
Testcase 2: In geeksquiz , decimal representation for g is 4 , e is 3 , k is 5 , s is 7 , q is 7 , u is 8 , i is 4 and z is 9. Hence, output for the given input will be 433577849.

hints:

https://www.geeksforgeeks.org/convert-sentence-equivalent-mobile-numeric-keypad-sequence/

https://www.geeksforgeeks.org/mobile-numeric-keypad-problem/

'''