#include <iostream>
using namespace std;
int main() {
int n,k=0; cin >> n;
double a[n][n]; int b[n];
for (int i=0; i<n; i++){
for (int j=0; j<n; j++){
cin >> a[i][j];
}
}
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++){cout << b[i]<<" ";}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbixrPTA7IGNpbiA+PiBuOwoJZG91YmxlIGFbbl1bbl07IGludCBiW25dOwoJZm9yIChpbnQgaT0wOyBpPG47IGkrKyl7CgkJZm9yIChpbnQgaj0wOyBqPG47IGorKyl7CgkJCWNpbiA+PiBhW2ldW2pdOwoJCX0KCX0KCWZvciAoaW50IGk9MDsgaTxuOyBpKyspewoJCWJbaV09MTsKCQlmb3IgKGludCBqPTA7IGo8bi0xOyBqKyspewoJCQlpZiAoYVtpXVtqXT5hW2ldW2orMV0pe2JbaV09MDsgYnJlYWs7fQoJCX0KCX0KCWZvciAoaW50IGk9MDsgaTxuOyBpKyspe2NvdXQgPDwgYltpXTw8IiAiO30KfQ==