import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
int[][] x = new int[n][n];
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
x[i][j] = in.nextInt();
}
}
for(int i = 0; i < n; i++) {
for(int j = i; j < n; j++) {
if(x
[i
][j
] == 1) System.
out.
println((i
+1) + " " + (j
+1)); }
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCWludCBuID0gaW4ubmV4dEludCgpOwoJCWludFtdW10geCA9IG5ldyBpbnRbbl1bbl07CgkJZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykgewoJCQlmb3IoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7CgkJCQl4W2ldW2pdID0gaW4ubmV4dEludCgpOwoJCQl9CgkJfQoJCWZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKCQkJZm9yKGludCBqID0gaTsgaiA8IG47IGorKykgewoJCQkJaWYoeFtpXVtqXSA9PSAxKSBTeXN0ZW0ub3V0LnByaW50bG4oKGkrMSkgKyAiICIgKyAoaisxKSk7CgkJCX0KCQl9Cgl9Cn0K