// editor4
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define SIZE 10
typedef struct Node {
    int key;
    char value[31];
    struct Node* next;
}Node;
Node* hashTable[SIZE];
int hashFunction(int key){
    return key % SIZE;
}
void addRecord(int key, char value[]){
    int index = hashFunction(key);
    Node* newNode = (Node*)malloc(sizeof(Node));
    newNode->key = key;
    strcpy(newNode->value, value);
    newNode->next = NULL;
    if(hashTable[index] == NULL){
        hashTable[index] = newNode;
    }else{
        Node* temp = hashTable[index];
        while (temp->next != NULL) {
        temp = temp->next;
    }
    temp->next = newNode;
}
printf("%s\n", value);
}
void findRecord(int key){
    int index = hashFunction(key);
    Node* temp = hashTable[index];
    while (temp != NULL){
        if(temp->key == key){
            printf("%s\n", temp->value);
            return;
        }
        temp = temp->next;
    }
    printf("Element not found\n");
}
int main(){
    int n;
    scanf("%d", &n);
    if(n < 0){
        printf("Invalid input");
        return 0;
    }
    for(int i = 0; i < n; i++){
        char commamnd[10];
        scanf("%s", command);
        if(strcmp(command, "ADD") == 0){
            int key;
            char value[31];
            scanf("%d %s", &key, value);
            addRecord(key, value);
        }
        else if (strcmp(command, "FIND") == 0){
            int key;
            scanf("%d", &key);
            findRecord(key);
        }
    }
    return 0;
}