#include <iostream>
using namespace std;
int main() {
int mat[100][100], n, m;
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
cin >> mat[i][j];
}
}
for (int i = 1; i <= n; ++i) {
int imp = 1;
for (int j = 1; j <= m; ++j) {
if (mat[i][j] % 2 == 0) {
imp = 0;
break;
}
}
if (imp == 1) {
cout << i << " ";
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbWF0WzEwMF1bMTAwXSwgbiwgbTsKCWNpbiA+PiBuID4+IG07Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQlmb3IgKGludCBqID0gMTsgaiA8PSBtOyArK2opIHsKCQkJY2luID4+IG1hdFtpXVtqXTsKCQl9Cgl9Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQlpbnQgaW1wID0gMTsKCQlmb3IgKGludCBqID0gMTsgaiA8PSBtOyArK2opIHsKCQkJaWYgKG1hdFtpXVtqXSAlIDIgPT0gMCkgewoJCQkJaW1wID0gMDsKCQkJCWJyZWFrOwoJCQl9CgkJfQoJCWlmIChpbXAgPT0gMSkgewoJCQljb3V0IDw8IGkgPDwgIiAiOwoJCX0KCX0KCXJldHVybiAwOwp9