#include <stdio.h>int main(){ int i,n,p,w,j,k,x[100] = {}; char a[50][1000]; scanf("%d" , &n); for(i = 0 ; i < n ; i ++); { scanf("%s %d" , a[i] , &x[i]); p = x; k = p; w = k; if(x[i] == w) { } } printf("%s" , a)}