#include<bits/stdc++.h>
using namespace std;
const int inf=100+5;
int n,a,b,pos[inf];
char ch='1';
bool tree[inf][inf];
int main(){
	freopen("query.in","r",stdin);
	freopen("query.out","w",stdout);
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> a >> b;
		pos[a]++;
		pos[b]++;
		tree[a]=b;
		tree[b]=ch-'0';
	} 
	/*for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(tree[i][j]){
				cout << i << " " << j <<endl;
			}
		}
	} */
	
	return 0;
} 
