import java.util.*;
import java.io.*;
import java.math.*;
class Ideone {
public static void main
(String args
[]) { Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
double[][] x = new double[n][n];
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
x[i][j] = in.nextDouble();
if(n >= 1){
for(int i = 0; i < n; i++){
/*последовательность монотонна, если сохраняет знак разность
между N-м и (N-1)-м членом последовательности.*/
double prevSign
= Math.
signum(x
[i
][1] - x
[i
][0]); //знак разности первой пары чисел boolean monotonic = true;
for(int j = 1; j < n; j++){
double newSign
= Math.
signum(x
[i
][j
] - x
[i
][j
-1]); //знак разности следующей пары if(prevSign * newSign <= 0){
monotonic = false;
j = n;
}
prevSign = newSign; //новая пара для сравнения
}
if(monotonic
) System.
out.
println(i
+1); }
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwppbXBvcnQgamF2YS5tYXRoLio7CiAKY2xhc3MgSWRlb25lIHsgCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmcgYXJnc1tdKSB7CiAJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogCQlpbnQgbiA9IGluLm5leHRJbnQoKTsKIAkJZG91YmxlW11bXSB4ID0gbmV3IGRvdWJsZVtuXVtuXTsKIAkJZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykgICAJCQogCQkJZm9yKGludCBqID0gMDsgaiA8IG47IGorKykKIAkJCQl4W2ldW2pdID0gaW4ubmV4dERvdWJsZSgpOwogCQlpZihuID49IDEpewogCQkJZm9yKGludCBpID0gMDsgaSA8IG47IGkrKyl7CiAJCQkJLyrQv9C+0YHQu9C10LTQvtCy0LDRgtC10LvRjNC90L7RgdGC0Ywg0LzQvtC90L7RgtC+0L3QvdCwLCDQtdGB0LvQuCDRgdC+0YXRgNCw0L3Rj9C10YIg0LfQvdCw0Log0YDQsNC30L3QvtGB0YLRjAogICAgICAgICAgICAJ0LzQtdC20LTRgyBOLdC8INC4IChOLTEpLdC8INGH0LvQtdC90L7QvCDQv9C+0YHQu9C10LTQvtCy0LDRgtC10LvRjNC90L7RgdGC0LguKi8KICAgICAgICAgICAgCWRvdWJsZSBwcmV2U2lnbiA9IE1hdGguc2lnbnVtKHhbaV1bMV0gLSB4W2ldWzBdKTsgLy/Qt9C90LDQuiDRgNCw0LfQvdC+0YHRgtC4INC/0LXRgNCy0L7QuSDQv9Cw0YDRiyDRh9C40YHQtdC7CiAgICAgICAgICAgIAlib29sZWFuIG1vbm90b25pYyA9IHRydWU7CiAgICAgICAgICAgIAlmb3IoaW50IGogPSAxOyBqIDwgbjsgaisrKXsKCSAgICAgICAgICAgICAgICBkb3VibGUgbmV3U2lnbiA9IE1hdGguc2lnbnVtKHhbaV1bal0gLSB4W2ldW2otMV0pOyAvL9C30L3QsNC6INGA0LDQt9C90L7RgdGC0Lgg0YHQu9C10LTRg9GO0YnQtdC5INC/0LDRgNGLCiAgICAgICAgICAgICAgICAJaWYocHJldlNpZ24gKiBuZXdTaWduIDw9IDApewoJICAgICAgICAgICAgICAgICAgICBtb25vdG9uaWMgPSBmYWxzZTsgCiAgICAgICAgICAgICAgICAgICAgCWogPSBuOwogICAgICAgICAgICAgICAgCX0KICAgICAgICAgICAgICAgIAlwcmV2U2lnbiA9IG5ld1NpZ247IC8v0L3QvtCy0LDRjyDQv9Cw0YDQsCDQtNC70Y8g0YHRgNCw0LLQvdC10L3QuNGPCiAgICAgICAgICAgIAl9CiAgICAgICAgICAgIAlpZihtb25vdG9uaWMpIFN5c3RlbS5vdXQucHJpbnRsbihpKzEpOwoJICAgICAgICB9CiAgICAJfQogICAgCWVsc2UgU3lzdGVtLm91dC5wcmludGxuKDEpOwoJfQp9