#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int oddNo = -1, evenNo = -1, currentNo;
for (int i = 1; i <= n; ++i) {
cin >> currentNo;
if (currentNo % 2 == 0) {
if (evenNo == -1) {
evenNo = currentNo;
}
} else {
oddNo = currentNo;
}
}
cout << evenNo << " " << oddNo;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbjsKCWNpbiA+PiBuOwoJaW50IG9kZE5vID0gLTEsIGV2ZW5ObyA9IC0xLCBjdXJyZW50Tm87Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQljaW4gPj4gY3VycmVudE5vOwoJCWlmIChjdXJyZW50Tm8gJSAyID09IDApIHsKCQkJaWYgKGV2ZW5ObyA9PSAtMSkgewoJCQkJZXZlbk5vID0gY3VycmVudE5vOwoJCQl9CgkJfSBlbHNlIHsKCQkJb2RkTm8gPSBjdXJyZW50Tm87CgkJfQoJfQoJY291dCA8PCBldmVuTm8gPDwgIiAiIDw8IG9kZE5vOwoJcmV0dXJuIDA7Cn0=