#include using namespace std; map m; map p; int main(){ int n; cin >> n; vector a(n); vector b(n); for(int i=0;i> a[i] >> b[i]; m[b[i]]=b[i]; p[b[i]]=0; } for(int i=0;i