#include <iostream>
using namespace std;
void listen (int n) {
int t;
cin >> t;
if (n > 1) {
listen (n - 1);
}
if (t % 2 == 0) {
cout << t << " ";
}
}
int main() {
int n;
cin >> n;
if (n > 0) {
listen (n);
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBsaXN0ZW4gKGludCBuKSB7CiAgICBpbnQgdDsKICAgIGNpbiA+PiB0OwogICAgaWYgKG4gPiAxKSB7CiAgICAgICAgbGlzdGVuIChuIC0gMSk7CiAgICB9CiAgICBpZiAodCAlIDIgPT0gMCkgewogICAgICAgIGNvdXQgPDwgdCA8PCAiICI7CiAgICB9Cn0KCmludCBtYWluKCkgewogICAgaW50IG47CiAgICBjaW4gPj4gbjsKICAgIGlmIChuID4gMCkgewogICAgICAgIGxpc3RlbiAobik7CiAgICB9Cn0=