#include using namespace std; #define int long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--) #define itn int #define all(x) (x).begin(),(x).end() #define F first #define S second const long long INF = 1LL << 60; const int MOD = 1000000007; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } signed main(void){ cin.tie(0); ios::sync_with_stdio(false); int n; cin>>n; map mp; vector list(n); map mp2; rep(i,n){ string s,t; cin>>s>>t; mp[s]++; list[i] = t; } rep(i,n){ if(mp[list[i]] == 0){ if(mp2[list[i]] == 0){ cout<