import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); int n,k=0;
n=in.nextInt();
double a[][] = new double [n][n];
int b[] = new int [n];
for (int i=0; i<n; i++){
for (int j=0; j<n; j++){
a[i][j]=in.nextDouble();
}
}
for (int i=0; i<n; i++){
b[i]=1;
for (int j=0; j<n-1; j++){
if (a[i][j]>a[i][j+1]){b[i]=0; break;}
}
}
for (int i
=0; i
<n
; i
++){System.
out.
printf("%d ",b
[i
]);} }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJaW50IG4saz0wOyAKCQluPWluLm5leHRJbnQoKTsKCQlkb3VibGUgYVtdW10gPSBuZXcgZG91YmxlIFtuXVtuXTsKCQlpbnQgYltdID0gbmV3IGludCBbbl07CgkJZm9yIChpbnQgaT0wOyBpPG47IGkrKyl7CgkJCWZvciAoaW50IGo9MDsgajxuOyBqKyspewoJCQkJYVtpXVtqXT1pbi5uZXh0RG91YmxlKCk7CgkJCX0KCQl9CgkJZm9yIChpbnQgaT0wOyBpPG47IGkrKyl7CgkJCWJbaV09MTsKCQkJZm9yIChpbnQgaj0wOyBqPG4tMTsgaisrKXsKCQkJCWlmIChhW2ldW2pdPmFbaV1baisxXSl7YltpXT0wOyBicmVhazt9CgkJCX0KCQl9CgkJZm9yIChpbnQgaT0wOyBpPG47IGkrKyl7U3lzdGVtLm91dC5wcmludGYoIiVkICIsYltpXSk7fQoJfQp9