#include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define SZ(n) (int)(n).size() #define ALL(n) (n).begin(), (n).end() using namespace std; typedef long long LL; typedef vector VI; int main() { int n; vector s, t; cin >> n; REP(i, n) { string st; cin >> st; s.push_back(st); } REP(i, n) { string tt; cin >> tt; t.push_back(tt); } int ans; REP(i, n) { if (s[i] != t[i]) { ans = i; break; } } cout << ans + 1 << endl; cout << s[ans] << endl; cout << t[ans] << endl; return 0; }