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: 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))

Python: def solve(mm, cmd):
	bf = cmd[0]
	c = 0
	ans = ""
	for s in cmd[1::]:
			if bf == s:
				c += 1
			else:
				if s == '0':
					ans += mm[bf][c%len(mm[bf])]
				c = 0
				bf = s
	return ans

def main():
	N = int(input())
	cc = [
		[".",",","!","?"," "],
		["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"]]
	mm = dict(zip(
		[str(i) for i in range(1,10)],
		cc
	))
	print(mm)
	for _ in range(N):
		cmd = input()
		print(solve(mm,cmd))

if __name__ == '__main__':
	main()

Python: # Keitai Message

ans = []

words = [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"]
        ]

n = int(input())
for j in range(n):
    a = list(input())
    tips = []
    cnt = 1
    ansT = ""
    for i in range(1, len(a)):
        if a[i] == a[i-1]:
            cnt += 1
        else:
            tips.append([int(a[i-1]), cnt])
            cnt = 1
    tips.append([int(a[-1]), cnt])

    for i in tips:
        if i[0] == 0:
            pass
        else:
            ansT += words[i[0]][i[1] % len(words[i[0]]) - 1]

    ans.append(ansT)

for i in ans:
    print(i)

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
        c += 1
    print(output)