#include<stdio.h>
#include<stdlib.h>
#include<string.h>


#define SIZE 10
 
 struct Node{
    int key;
    char value[30];
    struct Node* next;
};

struct Node* hashTable[SIZE];

int hashFunction(int key){
    return key % SIZE;
}

void add(int key,char value[]){
    int index=hashFunction(key);
    struct Node* newNode=(struct Node*)malloc(sizeof(struct Node));
    newNode->key = key;
    strcpy(newNode->value, value);
    newNode->next = hashTable[index];
    hashTable[index]= newNode;
    printf("%d\n", key);
}

void find(int key){
    int index=hashFunction(key);
    struct 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(opertaion,"ADD")==0){
            int key;
            char value[30];
            scanf("%d %s",&key,value);
            if(key<0){
                printf("Invalid input\n");
                return 0;
            }
            add(key,value);
        }
        else if (strcmp(opertaion, "FIND") ==0){
            int key;
            scanf("%d", &key);
            find(key);
        }
    }
    
    return 0;
}