#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define  SIZE 20
typedef struct Node {
    int key;
    char value[31];
    struct Node* next;
}Node;
Node* hashTable[SIZE];
int hashFunction(int key) {
    return key %SIZE;
}
void add(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("%d %s \n" , key value);
}
void find (int key){
    int intex = 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\n");
        return 0;
    }
    for (int i = 0; i < n ; i++) {
        char operation[10];
        scanf("%s", operation);
        if(strcmp(operation,  "ADD") == 0){
            int key;
            char value[31];
            scanf("%d %s", &key, value);
            add(key, value);
        }
        else if (strcmp(operation, "FIND") == 0) {
            int key ;
            scanf ("%d", &key);
            find(key);
        }
    }
    return 0;
}