#include <iostream>
using namespace std;
const int MAX_SIZE = 1000;
int main() {
int dataSize, sentPackage[MAX_SIZE], recievedPackage[MAX_SIZE];
cin >> dataSize;
for (int i = 0; i < dataSize; ++i) {
cin >> sentPackage[i];
}
for (int i = 0; i < dataSize - 1; ++i) {
cin >> recievedPackage[i];
}
int missingPacket = 0;
for (int i = 0; i < dataSize; ++i) {
if (sentPackage[i] != recievedPackage[i]) {
missingPacket = sentPackage[i];
i = dataSize;
}
}
cout << missingPacket;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWF9TSVpFID0gMTAwMDsKCmludCBtYWluKCkgewoJaW50IGRhdGFTaXplLCBzZW50UGFja2FnZVtNQVhfU0laRV0sIHJlY2lldmVkUGFja2FnZVtNQVhfU0laRV07CgljaW4gPj4gZGF0YVNpemU7Cglmb3IgKGludCBpID0gMDsgaSA8IGRhdGFTaXplOyArK2kpIHsKCQljaW4gPj4gc2VudFBhY2thZ2VbaV07Cgl9Cglmb3IgKGludCBpID0gMDsgaSA8IGRhdGFTaXplIC0gMTsgKytpKSB7CgkJY2luID4+IHJlY2lldmVkUGFja2FnZVtpXTsKCX0KCWludCBtaXNzaW5nUGFja2V0ID0gMDsKCWZvciAoaW50IGkgPSAwOyBpIDwgZGF0YVNpemU7ICsraSkgewoJCWlmIChzZW50UGFja2FnZVtpXSAhPSByZWNpZXZlZFBhY2thZ2VbaV0pIHsKCQkJbWlzc2luZ1BhY2tldCA9IHNlbnRQYWNrYWdlW2ldOwoJCQlpID0gZGF0YVNpemU7CgkJfQoJfQoJY291dCA8PCBtaXNzaW5nUGFja2V0OwoJcmV0dXJuIDA7Cn0=