#include using namespace std; #define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++) template bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; } template bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; } typedef long long ll; int N; set S,T; int main() { cin >> N; FOR(i,0,N){ string s; cin >> s; S.insert(s); } FOR(i,0,N){ string s; cin >> s; T.insert(s); } for(auto& it : S) if(T.count(it) == 0){ cout << it << endl; break; } for(auto& it : T) if(S.count(it) == 0){ cout << it << endl; break; } return 0; }