T9 Spelling

No attempts yetTime limit5sMemory limit512 MB

Problem

The Latin alphabet has 26 letters, but a telephone keypad has only ten digit keys. You want to write a message to a friend as the sequence of key presses that types it. Letters are assigned to digits as in the table below, and you type a letter by pressing its key as many times as its position on that key. For example, b is the second letter on key 2, so you press 22.

KeyLetters
2a, b, c
3d, e, f
4g, h, i
5j, k, l
6m, n, o
7p, q, r, s
8t, u, v
9w, x, y, z
0space

To type two letters that sit on the same key in a row, you have to pause before pressing the key again. Write one space character for that pause. So 2 2 types aa, while 22 types b. Pressing two different keys needs no pause, so no space goes between them.

Given a message, find the sequence of key presses that types it.

Input

The first line contains the number of test cases NN. Each of the next NN lines contains one message.

A message consists only of lowercase letters a to z and space characters. A space is typed with one press of key 0. Spaces at the start or the end of a message are part of the message and are typed like any other space.

Limits

  • 1N1001 \le N \le 100
  • 11 \le length of a message 1000\le 1000

Output

For each test case, print one line containing Case #x: followed by the sequence of key presses that types the message. Here xx is the test case number, starting at 1.