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

package main

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

// 標準入力を取得するScannerのインスタンスを作成
var scanner = bufio.NewScanner(os.Stdin)

// 標準入力で各行を読み込みstringとして返す
func readLine() string {
	if scanner.Scan() {
		return scanner.Text()
	}
	return ""
}

func main() {
	// 1: . , ! ? (スペース)
	// 2: a b c
	// 3: d e f
	// 4: g h i
	// 5: j k l
	// 6: m n o
	// 7: p q r s
	// 8: t u v
	// 9: w x y z
	// 0: 確定ボタン

	// 改行から空白区切りに変更
	scanner.Split(bufio.ScanWords)
	line, _ := strconv.Atoi(readLine()) // 5行標準入力が続く

	table := []string{
		"",      // 0 index調整ためダミーデータ
		".,!? ", // 1
		"abc",   // 2
		"def",   // 3
		"ghi",   // 4
		"jkl",   // 5
		"mno",   // 6
		"pqrs",  // 7
		"tuv",   // 8
		"wxyz"}  // 9

	// 5行分の標準入力を格納するsliceを作成する
	messages := make([]string, 0, line)

	// sliceに標準入力の内容を格納する
	for i := 0; i < line; i++ {
		messages = append(messages, readLine()) // messages=[20 220 222220 44033055505550666011011111090666077705550301110 000555555550000330000444000080000200004440000]
	}

	// 各行毎に解析する
	for _, message := range messages { // message=000555555550000330000444000080000200004440000
		// 0で分割する
		messageSlice := strings.Split(message, "0") // messageSlice=[   55555555    33    444    8    2    444    ]
		for _, word := range messageSlice {
			if word == "" {
				// NOP.
				// 0をセパレーターにしているので空文字がsliceに格納されてい箇所がある
				// 何もしない
			} else { // word=55555555
				// 一文字取り出しコード値をASCII文字に変換する
				ascii := string((word[0])) // word[0]=5

				// ASCII文字からintへ変換する(tableのindexになる)
				number, _ := strconv.Atoi(ascii)

				// 入力回数をカウントする
				count := len(word) // 5

				// 同じ数字を続けて入力すると変化する文字はループすることを考慮する
				for count > len(table[number]) { // 5 > 3
					count -= len(table[number]) // 2
				}

				// キー配列
				keys := table[number]                   //jkl
				fmt.Printf("%s", string(keys[count-1])) //k
			}
		}
		fmt.Println() // 改行
	}
}

Python: codes = [
    [],
    list('.,!? '),
    list('abc'),
    list('def'),
    list('ghi'),
    list('jkl'),
    list('mno'),
    list('pqrs'),
    list('tuv'),
    list('wxyz'),
]

n = int(input())
for _ in range(n):
    s = input()
    i = None
    cnt = 0
    ans = ''
    for si in list(s):
        sii = int(si)
        if sii == 0:
            if i is not None:
                ans += codes[i][cnt % len(codes[i])]
            i = None
        else:
            if i != sii:
                i = sii
                cnt = 0
            else:
                cnt += 1
    print(ans)

Python: w = [[''],['.',',','!','?',' '], ['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 _ in range(n):
    buff = ''
    s = input()
    push = 0
    times = 0
    for c in s:
        if int(c) == 0:
            buff += w[push][times%len(w[push])]
        if int(c) == push:
            times += 1
        else:
            push = int(c)
            times = 0
    print(buff)

Python: d = {'1': ['.', ',', '!', '?', ' '], '2': ['a', 'b', 'c'], '3': ['d', 'e', 'f'], '4': ['g', 'h', 'i'], '5': ['j', 'k', 'l'], '6': ['m', 'n', 'o'], '7': ['p', 'q', 'r', 's'], '8': ['t', 'u', 'v'], '9': ['w', 'x', 'y', 'z']}

n = int(input())
m = [input() for i in range(n)]
for mm in m:
    l = [x for x in mm.split('0') if not x == '']
    buf = ''
    for x in l:
        buf += d[x[0]][len(x)%len(d[x[0]]) - 1]
    print(buf)

Python: # AOJ 2006: Keitai Message
# Python3 2018.6.20 bal4u

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

for _ in range(int(input())):
	ans = []
	s, i = list(input()), 0
	while i < len(s):
		if s[i] != '0':
			id, k = int(s[i]), 0
			i += 1
			while s[i] != '0':
				i += 1
				k += 1
			ans.append(tbl[id][k % len(tbl[id])]);
		i += 1
	print(*ans, sep='')

Python: d = {'1': ['.', ',', '!', '?', ' '], '2': ['a', 'b', 'c'], '3': ['d', 'e', 'f'], '4': ['g', 'h', 'i'], '5': ['j', 'k', 'l'], '6': ['m', 'n', 'o'], '7': ['p', 'q', 'r', 's'], '8': ['t', 'u', 'v'], '9': ['w', 'x', 'y', 'z']}

n = int(input())
m = [input() for i in range(n)]
for mm in m:
    l = [x for x in mm.split('0') if not x == '']
    for x in l:
        print(d[x[0]][len(x)%len(d[x[0]]) - 1])
    print()

Python: from itertools import cycle as c

n=int(input())
for _ in range(n):
  t=input()
  l=[]
  bf=""
  for nn in map(int,t):
    if not nn:
      l.extend([bf])
      bf=""
      continue
    if not bf:
      if nn:
        kl=[
          c(".,!? "),
          c("abc"),
          c("def"),
          c("ghi"),
          c("jkl"),
          c("mno"),
          c("pqrs"),
          c("tuv"),
          c("wxyz")
        ]
        bf=next(kl[nn-1])
    else:
      bf=next(kl[nn-1])
  print("".join(l))

Python: N = int(input())
d = []
d.append([])
d.append([".",",","!","?"])
d.append(["a","b","c"])
d.append(["d","e","f"])
d.append(["g","h","i"])
d.append(["j","k","l"])
d.append(["m","n","o"])
d.append(["p","q","r","s"])
d.append(["t","u","v"])
d.append(["w","x","y","z"])
for _ in range(N):
    nn = input()
    output = ""
    b = 0
    c = 0
    for n in nn:
        n = int(n)
        if n == 0:
            output += d[b][c]
            c = 0
        b = n

Python: def solve():
    from sys import stdin
    f_i = stdin
    
    buttons = {
            '1': ".,!? ",
            '2': "abc",
            '3': "def",
            '4': "ghi",
            '5': "jkl",
            '6': "mno",
            '7': "pqrs",
            '8': "tuv",
            '9': "wxyz",
            }
    
    n = int(f_i.readline())
    
    ans = ""
    
    for i in range(n):
        code = f_i.readline().rstrip().split('0')
        
        for c in filter(lambda x: x != '', code):
            btn_chars = buttons[c[0]]
            idx = (len(c) - 1) % len(btn_chars)
            ans += btn_chars[idx]
            
        ans += '\n'
        
    print(ans, end='')

solve()

Python: n = int(input())
abc = [".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"]
for i in range(n):
  s = input()
  ans = ""
  cur = -1
  num = -1
  for e in s:
    e = int(e)
    if cur ==-1 and e==0:
      continue
    elif e==0:
      t = len(abc[cur-1])
      ans += abc[cur-1][num%t]
      num = -1
      cur = -1
    else:
      cur = e
      num += 1
  print(ans)

Python: lists = [[".",",","!","?"," "],["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"]]
cnt = 0
moji = []
ans = []
n = int(input())
for k in range(n):
    s = str(input())
    for i in range(len(s)):
        if s[i] != "0":
            cnt += 1
            tmp = int(s[i])
            if cnt > len(lists[tmp-1]):
                cnt = cnt - len(lists[tmp-1]) 
            
        elif s[i] == "0" and cnt != 0:
                moji.append(lists[tmp - 1][int(cnt)-1])
                cnt = 0
    mojimoji = "".join(moji)
    ans.append(mojimoji)
    moji = []
for i in ans:
    print(i)

Python: chars = (None, '.,!? ', 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz')
n = int(input())

while n:
    n -= 1
    s = input()
    number, counter = 0, 0
    for c in s:
        if c == '0':
            if number:
                charset = chars[number]
                print(charset[(counter - 1) % len(charset)], end='')
                number, counter = 0, 0
        elif counter:
            counter += 1
        else:
            number = int(c)
            counter = 1
    print()

Python: if __name__ == '__main__':
    n = int(input())
    moji =[[],[' ','.',',','!','?'],['c','a','b'],['f','d','e'],['i','g','h'],['l','j','k'],['o','m','n'],['s','p','q','r'],['v','t','u'],['z','w','x','y']]
    for _ in range(n):
        line = list(input().strip().replace('0',' ').split())
        ans = []
        for i in line:
            m=int(i[0])
            ans.append(moji[m][len(i)%len(moji[m])])
        print(''.join(ans))