#include<stdio.h> typedef struct{ int key; int val; }KeyVal; int main(){ int n; scanf("%d",&n); KeyVal keyVal[n]; for(int i=0;i<n;i++){ scanf("%d %d",&keyVal[i].key,&keyVal[i].val); } for(int i=0;i+1<n;i++){ for(int j=i+1;j<n;j++){ if(keyVal[i].key==keyVal...