#include <bits/stdc++.h>
using namespace std;
int main() {
vector <int> a;
int temp;
while (cin >> temp) {
a.push_back(temp);
if (cin.get() == '\n') {
break;
}
}
for (int i = 0; i < a.size(); i++) {
if (a[i] % 4 == 0) {
cout << i + 1;
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkgewogICAgdmVjdG9yIDxpbnQ+IGE7CiAgICBpbnQgdGVtcDsKICAgIHdoaWxlIChjaW4gPj4gdGVtcCkgewogICAgICAgIGEucHVzaF9iYWNrKHRlbXApOwogICAgICAgIGlmIChjaW4uZ2V0KCkgPT0gJ1xuJykgewogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICB9CiAgICBmb3IgKGludCBpID0gMDsgaSA8IGEuc2l6ZSgpOyBpKyspIHsKICAgICAgICBpZiAoYVtpXSAlIDQgPT0gMCkgewogICAgICAgICAgICBjb3V0IDw8IGkgKyAxOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiAwOwp9