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: 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], end='')
    print()

Python: n = int(input())
string = ["", ".,!? ", "abc", "def", "ghi",
          "jkl", "mno", "pqrs", "tuv", "wxyz"]
for i in range(n):
    s = input()
    count = 0
    num = int(s[0])
    for c, c1 in zip(s, s[1:]):
        if c == c1:
            count += 1
        else:
            if num != 0:
                print(string[num][count % len(string[num])], end="")
            else:
                pass
            num = int(c1)
            count = 0
    print()

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 _ in range(n)]
ans = [[d[cs[0]][len(cs) % len(d[cs[0]]) - 1] for cs in line.split("0") if cs != ""] for line in m]
for a in ans:
    print(*a, 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 _ in range(n)]
for line in m:
    ans = []
    for cs in line.split("0"):
        if cs == "":
            continue
        index = len(cs) % len(d[cs[0]]) - 1
        ans.append(d[cs[0]][index])
    print("".join(ans))

Python: import sys
K = '.,!? '
A = 'abc'
D = 'def'
G = 'ghi'
J = 'jkl'
M = 'mno'
P = 'pqrs'
T = 'tuv'
W = 'wxyz'
L = ['', K, A, D, G, J, M, P, T, W]
count = int(input())
while count:
	count -= 1
	S = []
	n = input()
	if not '0' in n:
		print('')
		continue
	else:
		n = n.split('0')
		for ns in n:
			if ns == '':
				continue
			i = len(ns) % len(L[int(ns[0])])
			S += [[L[int(ns[0])], i-1]]
		for s in S:
			print(s[0][s[1]], end='')
		print('')
		continue

Python: from itertools import cycle as c

n=int(input())
for _ in range(n):
    tt=input()
    l=[]
    t=""
    for (i,j) in enumerate(tt):
        ct=int(j)
        if ct==0 or i==0:
            if i!=0:
                l.extend([t])
                t=""
            kk=[c([".",",","!","?"," "]),
                c(["a","b","c"]),
                c(["d","e","f"]),
                c(["g","h","i"]),
                c(["j","k","l"]),
                c(["m","n","o"]),
                c(["p","q","r","s"]),
                c(["t","u","v"]),
                c(["w","x","y","z"])]
        if ct!=0 :
            t=kk[ct-1].next()
    print("".join(l))

Python: def moji(x,ans):
    if ans == 0:
        return
    if x == 1:
        if(ans%5==1):
            str = '.'
        elif(ans%5==2):
            str =','
        elif(ans%5==3):
            str='!'
        elif ans%5==4:
            str='?'
        else:
            str = ' '
    if x == 2:
        if(ans%3==1):
            str = 'a'
        elif(ans%3==2):
            str = 'b'
        else:
            str = 'c'
    if x == 3:
        if(ans%3==1):
            str = 'd'
        elif(ans%3==2):
            str = 'e'
        else:
            str = 'f'
    if x == 4:
        if(ans%3==1):
            str = 'g'
        elif(ans%3==2):
            str = 'h'
        else:
            str = 'i'
    if x == 5:
        if(ans%3==1):
            str = 'j'
        elif(ans%3==2):
            str = 'k'
        else:
            str = 'l'
    if x == 6:
        if(ans%3==1):
            str = 'm'
        elif(ans%3==2):
            str = 'n'
        else:
            str = 'o'
    if x == 7:
        if(ans%4==1):
            str = 'p'
        elif(ans%4==2):
            str = 'q'
        elif(ans%4==3):
            str ='r'
        else:
            str = 's'
    if x == 8:
        if(ans%3==1):
            str = 't'
        elif(ans%3==2):
            str = 'u'
        else:
            str = 'v'
    if x == 9:
        if(ans%4==1):
            str = 'w'
        elif(ans%4==2):
            str = 'x'
        elif ans%4==3:
            str = 'y'
        else:
            str = 'z'
    print(str,end="")
def solve(str):
    x = '-1'
    ans =0
    for s in str:
        if s == '0':
            moji(int(x),ans)
            ans = 0
        else:
            x = s
            ans +=1

N = int(input())
for i in range(N):
    solve(input())
    print()

Python: #!/usr/bin/python3

def atoi(c):
    return ord(c) - ord('0')

table = [(), #dummy
        ('.',',','!','?'),\
        ('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):
    digits = list(input())
    s = ""
    c = ''
    m = 0
    for d in digits:
        if d == '0':
            s += c
            c = ''
            m = 0
        else:
            c = table[atoi(d)][m]
            m = (m + 1) % len(table[atoi(d)])
    print(s)