import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; public class Main{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] b = new int[n]; for(int i = 0; i < n; i++){ b[i] = 0; String line = br.readLine(); if(line.charAt(line.length()-1) == ' ') System.exit(1); String[] arr = line.split(" "); if(arr.length != n) System.exit(1); for(int j = 0; j < n; j++){ int x = Integer.parseInt(arr[j]); b[i] += (1<>j)&1) == 1) score += a[j]; } // 高速化出来る(しなくてもよい) // if(score >= ans) continue; int lie = i, confess = 0, k = -1; while(++k < n){ if(((confess>>k)&1) == 1) continue; if((lie&b[k]) == b[k]){ confess |= 1<