Go: // Keitai Message
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2006&lang=jp
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var table = []string{
	"",
	".,!? ",
	"abc",
	"def",
	"ghi",
	"jkl",
	"mno",
	"pqrs",
	"tuv",
	"wxyz",
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := nextInt(sc)

	for i := 0; i < n; i++ {
		message := nextString(sc)
		currentButton, count := 0, 0
		for _, word := range message {
			// 確定の処理を書く
			if word == '0' {
				if currentButton == 0 {
					count = 0
					continue
				}
				mod := len(table[currentButton])
				tmp := table[currentButton][(count-1)%mod]
				currentButton, count = 0, 0
				fmt.Printf("%c", tmp)
			} else {
				count++
				currentButton = int(word) - 48 // '0'はASCIIで48
			}
		}
		fmt.Println()
	}
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

Python: a = ["" for i in range(10)]
a[1] = ".,!? "
a[2] = "abc"
a[3] = "def"
a[4] = "ghi"
a[5] = "jkl"
a[6] = "mno"
a[7] = "pqrs"
a[8] = "tuv"
a[9] = "wxyz"
num = int(input())
for count in range(num):
    s = input()
    b = ""
    c = '0'
    d = 0
    for i in s:
        if i=='0' :
            if c=='0': continue
            if c == '1':
                b += a[int(c)][d%5]
            elif c in "79":
                b += a[int(c)][d%4]
            else :
                b += a[int(c)][d%3]
            c = '0'
            d = 0
        if(c!=i):
            c = i
            d = 0
        else :
            d += 1
    print(b)

Python: a=[['.',',','!','?',' '],['a','b','c'],['d','e','f'],['g','h','i'],['j','k','l'],['m','n','o'],['p','q','r','s'],['t','u','v'],['w','x','y','z']]
for _ in range(int(input())):
    b=list(filter(lambda x: x!='',input().split('0')))
    for c in b:
        d=int(c[0])-1
        print(a[d][(len(c)-1)%len(a[d])],end='')
    print()

Python: moji_lis = [[".",",","!","?"," "],["a","b","c"],["d","e","f"],["g","h","i"],["j","k","l"],["m","n","o"],["p","q","r","s"],["t","u","v"],["w","x","y","z"]]
n = int(input())
for i in range(n):
    N_lis = list(input())
    N_lis = list(map(int,N_lis))
    
    a_0 = N_lis[0]
    n_num = 1
    moji = ""
    for j in range(1,len(N_lis)):

        a_1 = N_lis[j]
        
        if a_0 == a_1:
            n_num += 1
        else:
            if a_0 == 1:
                moji += moji_lis[0][(n_num - 1) % 5]
                
            elif a_0 == 7 or a_0 == 9:
        
                moji += moji_lis[a_0 - 1][(n_num - 1) % 4]
           
                
            elif a_0 != 0:
  
                moji += moji_lis[a_0 - 1][(n_num - 1) % 3]
                
        a_0 = a_1
        if a_1 == 0:
            n_num = 1
    print(moji)

Python: s = [0,['.',',','!','?',' '],['a','b','c'],['d','e','f'],['g','h','i'],['j','k','l'],['m','n','o'],['p','q','r','s'],['t','u','v'],['w','x','y','z']]
for _ in range(int(input())):
    l = list(filter(lambda x: x!='', input().split('0')))
    r = ''
    for d in l:
        i,j = int(d[0]),len(d)-1
        r += s[i][j%len(s[i])]
    print(r)

Python: import sys

litter = [""]
litter.append(list(" .,!? "))
litter.append(list(" abc"))
litter.append(list(" def"))
litter.append(list(" ghi"))
litter.append(list(" jkl"))
litter.append(list(" mno"))
litter.append(list(" pqrs"))
litter.append(list(" tuv"))
litter.append(list(" wxyz"))

n = input()
for count in range(n):
    ls = map(int, list(raw_input()))
    button, times = None, 0
    for i in ls:
        if i==0 :
            if button != None:
                sys.stdout.write(litter[button][times])
                button, times = None, 0
        else:
            button, times = i, times+1
            if times == len(litter[button]):
                times = 1
    sys.stdout.write('\n')

Python: keylist = [
   [],
   ['.', ',', '!', '?', ' '],
   ['a', 'b', 'c'],
   ['d', 'e', 'f'],
   ['g', 'h', 'i'],
   ['j', 'k', 'l'],
   ['m', 'n', 'o'],
   ['p', 'q', 'r', 's'],
   ['t', 'u', 'v'],
   ['w', 'x', 'y', 'z']
]
for i in range(int(input())):
   output = ''
   for item in input().split('0'):
      if item == '':
         continue
      output += keylist[int(item[0])][len(item) % len(keylist[int(item[0])]) - 1]
   print(output)

Python: dats=[0,[".",",","!","?"," "],["a","b","c"],["d","e","f"],["g","h","i"],["j","k","l"],["m","n","o"],["p","q","r","s"],["t","u","v"],['w','x','y','z']]
for p in range(input()):
    a=raw_input().split('0')
    b=""
    for i in range(len(a)):
        if a[i]!="":
            c=a[i]
            b=b+dats[int(c[0])][len(c)%len(dats[int(c[0])])-1]
    print(b)

Python: def set(mess) :
  Mess = list(mess.split("0"))
  Ml = len(Mess)
  for i in range(Ml) :
    if("" in Mess) :
      Mess.remove("")
      # Mess 内の1番インデックスの小さい""を削除
    else :
      break
  ML = len(Mess)
  change(Mess, ML)

def change(Mess, ML) :
  one = [".", ",", "!", "?", " "]
  alpha = [chr(i) for i in range(97, 97 + 26)]

  Num = list()
  Cnt = list()
  for i in range(ML) :
    a = list(Mess[i])
    Num.append(a[0])
    Cnt.append(len(a))

  ans = list()
  for i in range(ML) :
    if(Num[i] == "1") :
      ans.append(one[Cnt[i] % 5 - 1])
    elif(Num[i] == "7") :
      ans.append(alpha[(Cnt[i]-1)% 4 + 15])
    elif(Num[i] == "8") :
      ans.append(alpha[(Cnt[i]-1)% 3 + 19])
    elif(Num[i] == "9") :
      ans.append(alpha[(Cnt[i]-1)% 4 + 22])
    else :
      x = 3 * (int(Num[i]) - 2)
      ans.append(alpha[(Cnt[i]-1) % 3 + x])

  for j in range(len(ans)) :
    if(j == len(ans) - 1) :
      print(ans[j])
    else :
      print(ans[j], end = "")

N = int(input())
for i in range(N) :
  mess = input()

  set(mess)

Python: dic = [None, '.,!? ','abc','def','ghi','jkl','mno','pqrs','tuv','wxyz']

N = int(input())
for i in range(N):
    S = input()
    ans = ''
    btn = n = -1
    for c in S:
        if c == '0':
            if btn > 0:
                ans += dic[int(btn)][n % len(dic[int(btn)])]
                btn = n = -1
        else:
            btn = int(c)
            n += 1
    print(ans)

Python: import itertools

table = {	1: '.,!? ',
			2: 'abc',
			3: 'def',
			4: 'ghi',
			5: 'jkl',
			6: 'mno',
			7: 'pqrs',
			8: 'tuv',
			9: 'wxyz' }

for i in range(int(input())):
	s = input()
	r = ''
	for k, g in itertools.groupby(s):
		if k == '0':
			continue
		k = int(k)
		i = (len(list(g)) - 1) % len(table[k])
		r += table[k][i]
	print(r)

Python: char = ["",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"]
n = int(input())

for _ in range(n):
    s = input()
    ans = ""
    flag = True
    prev = 0
    cnt = 0
    for i in s:
        if i != '0':
            prev = int(i)
            cnt += 1
        elif cnt != 0:
            ans += char[prev][(cnt - 1) % len(char[prev])]
            cnt = 0
    print(ans)

Python: button = [0, ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"]

n = int(input())
for i in range(n):
    s = input()

    cnt = 0
    key = "0"

    for c in s:
        if c != "0":
            cnt += 1
            key = c
        else:
            if key == "0":
                cnt = 0
                continue
            else:
                print(button[int(key)][(cnt - 1) % len(button[int(key)])], end = "")
                cnt = 0
                key = "0"

    print()

Python: d={'7': ['p', 'q', 'r', 's'], '2': ['a', 'b', 'c'], '1': ['.', ',', '!', '?'," "], '3': ['d', 'e', 'f'], '9': ['w', 'x', 'y', 'z'], '5': ['j', 'k', 'l'], '8': ['t', 'u', 'v'], '4': ['g', 'h', 'i'], '6': ['m', 'n', 'o']}
time=int(input())
for i in range (time):
    answer=[]
    word=input().split("0")
    while "" in word: word.remove("")
    for i in word:
        answer.append(d[i[0]][len(i)%len(d[i[0]])-1])
    print("".join(answer))