using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace Test1 {

    class ClassMain {

        
        

        public static void Main(String[] args) {
            string line;
            while ((line = Console.ReadLine()) != null) {
                int n = int.Parse(line);
                for (int x = 0; x < n; x++) {
                    line = Console.ReadLine();
                    string[] strs = line.Split('0');
                    String message = "";
                    for (int i = 0; i < strs.Length; i++) {
                        message += makeMoji(strs[i]);
                    }


                    Console.WriteLine(message);
                }
            }      
        }


        private static string makeMoji(string str) {
            if (str == "") { return ""; }
            string moji="";
            int len = str.Length;
            int num = int.Parse(str.ToCharArray()[0]+"");
            switch (num) {
                case 1:
                    len -= 1; len %=5; len++;
                    if (len == 1) { moji = "."; }
                    else if (len == 2) { moji = ","; }
                    else if (len == 3) { moji = "!"; }
                    else if (len == 4) { moji = "?"; }
                    else if (len == 5) { moji = " "; }
                    break;
                case 2:
                    len -= 1; len %= 3; len++;
                    if (len == 1) { moji = "a"; }
                    else if (len == 2) { moji = "b"; }
                    else if (len == 3) { moji = "c"; }
                    break;
                case 3:
                    len -= 1; len %= 3; len++;
                    if (len == 1) { moji = "d"; }
                    else if (len == 2) { moji = "e"; }
                    else if (len == 3) { moji = "f"; }
                    break;
                case 4:
                    len -= 1; len %= 3; len++;
                    if (len == 1) { moji = "g"; }
                    else if (len == 2) { moji = "h"; }
                    else if (len == 3) { moji = "i"; }
                    break;
                case 5:
                    len -= 1; len %= 3; len++;
                    if (len == 1) { moji = "j"; }
                    else if (len == 2) { moji = "k"; }
                    else if (len == 3) { moji = "l"; }
                    break;
                case 6:
                    len -= 1; len %= 3; len++;
                    if (len == 1) { moji = "m"; }
                    else if (len == 2) { moji = "n"; }
                    else if (len == 3) { moji = "o"; }
                    break;
                case 7:
                    len -= 1; len %= 4; len++;
                    if (len == 1) { moji = "p"; }
                    else if (len == 2) { moji = "q"; }
                    else if (len == 3) { moji = "r"; }
                    else if (len == 4) { moji = "s"; }
                    break;
                case 8:
                    len -= 1; len %= 3; len++;
                    if (len == 1) { moji = "t"; }
                    else if (len == 2) { moji = "u"; }
                    else if (len == 3) { moji = "v"; }
                    break;
                case 9:
                    len -= 1; len %= 4; len++;
                    if (len == 1) { moji = "w"; }
                    else if (len == 2) { moji = "x"; }
                    else if (len == 3) { moji = "y"; }
                    else if (len == 4) { moji = "z"; }
                    break;
            }
            return moji;
        }
       

        

    }

}

Measured memory_bytes: 5524