#include <cstdio>
int sign(double x){
return (x > 0) - (x < 0);
}
int main() {
size_t n; scanf("%d", &n);
double x[n][n];
for(size_t i = 0; i < n; i++)
for(size_t j = 0; j < n; j++)
scanf("%lf", &x[i][j]);
if(n >= 1) {
for(size_t i = 0; i < n; i++){
/*последовательность монотонна, если сохраняет знак разность
между N-м и (N-1)-м членом последовательности.*/
int prev_sign = sign(x[i][1] - x[i][0]); //знак разности первой пары чисел
bool monotonic = true;
for(size_t j = 1; j < n; j++){
int new_sign = sign(x[i][j] - x[i][j - 1]); //знак разности следующей пары
if(prev_sign * new_sign <= 0){
monotonic = false;
j = n;
}
prev_sign = new_sign; //новая пара для сравнения
}
if(monotonic) printf("%d ", i + 1);
}
}
else printf("1\n");
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KaW50IHNpZ24oZG91YmxlIHgpewoJcmV0dXJuICh4ID4gMCkgLSAoeCA8IDApOwp9CgppbnQgbWFpbigpIHsKCXNpemVfdCBuOyBzY2FuZigiJWQiLCAmbik7Cglkb3VibGUgeFtuXVtuXTsKCWZvcihzaXplX3QgaSA9IDA7IGkgPCBuOyBpKyspCgkJZm9yKHNpemVfdCBqID0gMDsgaiA8IG47IGorKykKCQkJc2NhbmYoIiVsZiIsICZ4W2ldW2pdKTsKCQkJCglpZihuID49IDEpIHsKCQlmb3Ioc2l6ZV90IGkgPSAwOyBpIDwgbjsgaSsrKXsKCQkJLyrQv9C+0YHQu9C10LTQvtCy0LDRgtC10LvRjNC90L7RgdGC0Ywg0LzQvtC90L7RgtC+0L3QvdCwLCDQtdGB0LvQuCDRgdC+0YXRgNCw0L3Rj9C10YIg0LfQvdCw0Log0YDQsNC30L3QvtGB0YLRjAoJCQnQvNC10LbQtNGDIE4t0Lwg0LggKE4tMSkt0Lwg0YfQu9C10L3QvtC8INC/0L7RgdC70LXQtNC+0LLQsNGC0LXQu9GM0L3QvtGB0YLQuC4qLwoJCQlpbnQgcHJldl9zaWduID0gc2lnbih4W2ldWzFdIC0geFtp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