/*
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * This template uses "new style" C++ strings, using the String class.
 * If you are more comfortable using the "old style" C string, please
 * look at the template specific for C.
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * NOTE: it is recommended to use this even if you don't
 * understand the following code.
 */

#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

// constraints
const int MAXN = 100;

// input data
int N;
string contacts[MAXN];
string codes[10];

int main() {
//  uncomment the following lines if you want to read/write from files
//  freopen("input.txt", "r", stdin);
//  freopen("output.txt", "w", stdout);

    cin >> N;
    for (int i = 0; i < N; i++)
        cin >> contacts[i];
    for (int i = 0; i < 10; i++)
        cin >> codes[i];

    for (int i = 0; i < N; i++) {
        // insert your code here and change what you print
        cout << contacts[i] << endl;
    }
   
    return 0;
}
