// April Fools 2021 G. Encoded message.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

int main()
{
    int N;
    cin >> N;

    char line[24] = {' '}, temp[5];
    for (int i = 0; i < N; i++) {
        cin >> temp[0] >> temp[1] >> temp[2] >> temp[3] >> temp[4];
        
        if (temp[0] == '1' && temp[1] == '0' && temp[2] == '0' && temp[3] == '1' && temp[4] == '0') line[i] = 'a';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '0' && temp[3] == '2' && temp[4] == '0') line[i] = 'b';
        else if (temp[0] == '2' && temp[1] == '0' && temp[2] == '0' && temp[3] == '1' && temp[4] == '1') line[i] = 'c';
        else if (temp[0] == '2' && temp[1] == '1' && temp[2] == '0' && temp[3] == '1' && temp[4] == '2') line[i] = 'd';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '0' && temp[3] == '1' && temp[4] == '1') line[i] = 'e';
        else if (temp[0] == '2' && temp[1] == '1' && temp[2] == '0' && temp[3] == '2' && temp[4] == '1') line[i] = 'f';
        else if (temp[0] == '2' && temp[1] == '2' && temp[2] == '0' && temp[3] == '2' && temp[4] == '2') line[i] = 'g';
        else if (temp[0] == '1' && temp[1] == '2' && temp[2] == '0' && temp[3] == '2' && temp[4] == '1') line[i] = 'h';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '0' && temp[3] == '1' && temp[4] == '1') line[i] = 'i';
        else if (temp[0] == '1' && temp[1] == '2' && temp[2] == '0' && temp[3] == '1' && temp[4] == '2') line[i] = 'j';
        else if (temp[0] == '1' && temp[1] == '0' && temp[2] == '1' && temp[3] == '2' && temp[4] == '0') line[i] = 'k';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '1' && temp[3] == '3' && temp[4] == '0') line[i] = 'l';
        else if (temp[0] == '2' && temp[1] == '0' && temp[2] == '1' && temp[3] == '2' && temp[4] == '1') line[i] = 'm';
        else if (temp[0] == '2' && temp[1] == '1' && temp[2] == '1' && temp[3] == '2' && temp[4] == '2') line[i] = 'n';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '1' && temp[3] == '2' && temp[4] == '1') line[i] = 'o';
        else if (temp[0] == '2' && temp[1] == '1' && temp[2] == '1' && temp[3] == '3' && temp[4] == '1') line[i] = 'p';
        else if (temp[0] == '2' && temp[1] == '2' && temp[2] == '1' && temp[3] == '3' && temp[4] == '2') line[i] = 'q';
        else if (temp[0] == '1' && temp[1] == '2' && temp[2] == '1' && temp[3] == '3' && temp[4] == '1') line[i] = 'r';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '1' && temp[3] == '2' && temp[4] == '1') line[i] = 's';
        else if (temp[0] == '1' && temp[1] == '2' && temp[2] == '1' && temp[3] == '2' && temp[4] == '2') line[i] = 't';
        else if (temp[0] == '1' && temp[1] == '0' && temp[2] == '2' && temp[3] == '2' && temp[4] == '1') line[i] = 'u';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '2' && temp[3] == '3' && temp[4] == '1') line[i] = 'v';
        else if (temp[0] == '1' && temp[1] == '2' && temp[2] == '1' && temp[3] == '1' && temp[4] == '3') line[i] = 'w';
        else if (temp[0] == '2' && temp[1] == '0' && temp[2] == '2' && temp[3] == '2' && temp[4] == '2') line[i] = 'x';
        else if (temp[0] == '2' && temp[1] == '1' && temp[2] == '2' && temp[3] == '2' && temp[4] == '3') line[i] = 'y';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '2' && temp[3] == '2' && temp[4] == '2') line[i] = 'z';
        else if (temp[0] == '1' && temp[1] == '1' && temp[2] == '2' && temp[3] == '1' && temp[4] == '3') line[i] = '#';
        else line[i] = ' ';
    }

    for (int i = 0; i < N; i++) {
        cout << line[i];
    }
    cout << endl;
    
    return 0;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
