#include <iostream>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (d % 2 != 0) {
cout << 4 << " ";
}
if (c % 2 != 0) {
cout << 3 << " ";
}
if (b % 2 != 0) {
cout << 2 << " ";
}
if (a % 2 != 0) {
cout << 1 << " ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgYSwgYiwgYywgZDsKCWNpbiA+PiBhID4+IGIgPj4gYyA+PiBkOwoJaWYgKGQgJSAyICE9IDApIHsKCQljb3V0IDw8IDQgPDwgIiAiOwoJfQoJaWYgKGMgJSAyICE9IDApIHsKCQljb3V0IDw8IDMgPDwgIiAiOwoJfQoJaWYgKGIgJSAyICE9IDApIHsKCQljb3V0IDw8IDIgPDwgIiAiOwoJfQoJaWYgKGEgJSAyICE9IDApIHsKCQljb3V0IDw8IDEgPDwgIiAiOwoJfQoJcmV0dXJuIDA7Cn0=