Telephone Number

Time limit: 5000ms
Memory limit: 256mb

Description:
Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Waterloo by dialing the memorable TUT-GLOP. Sometimes only part of the number is used to spell a word. When you get back to your hotel tonight you can order a pizza from Gino's by dialing 310-GINO. Another way to make a telephone number memorable is to group the digits in a memorable way. You could order your pizza from Pizza Hut by calling their ``three tens'' number 3-10-10-10. 
The standard form of a telephone number is seven decimal digits with a hyphen between the third and fourth digits (e.g. 888-1200). The keypad of a phone supplies the mapping of letters to numbers, as follows: 



Hyphens are not dialed, and can be added and removed as necessary. The standard form of TUT-GLOP is 888-4567, the standard form of 310-GINO is 310-4466, and the standard form of 3-10-10-10 is 310-1010.
Your company is compiling a directory of telephone numbers from local businesses. You need to convert all telephone numbers in the directory to its standard form.

Input:
The input will consist of one case. The first line of the input specifies the number of telephone numbers in the directory (up to 1000) as a positive integer, N, alone on the line. The remaining lines list the telephone numbers in the directory, with each number alone on a line. Each telephone number consists of a string composed of decimal digits, uppercase letters and hyphens. Exactly seven of the characters in the string will be digits or letters and there will be at most 1000 characters. 

Output:
The output should consist of N lines. The i-th line consists of a string which is the standard form of i-th telephone number.

Sample Input:
12
4873279
ITS-EASY
888-4567
3-10-10-10
888-GLOP
TUT-GLOP
967-11-11
310-GINO
F101010
888-1200
-4-8-7-3-2-7-9-
487-3279

Sample Output:
487-3279
487-3279
888-4567
310-1010
888-4567
888-4567
967-1111
310-4466
310-1010
888-1200
487-3279
487-3279
Submit