from os import cpu_count import sys,random,bisect from collections import deque,defaultdict from heapq import heapify,heappop,heappush from itertools import permutations from math import log,gcd input = lambda :sys.stdin.readline() mi = lambda :map(int,input().split()) li = lambda :list(mi()) popcount = [bin(i).count("1") for i in range(2**16)] N = int(input()) A = [li() for i in range(N)] #A = [[random.randint(0,99)&1 for j in range(N)] for i in range(N)] #for i in range(N): #for j in range(i+1,N): #A[i][j] = 1 - A[j][i] dp = [[0 for i in range(N)] for S in range(1<>j & 1==0: continue for k in range(j+1,N): if A[j][k]: dp[S][j] += dp[tmp][j] * dp[S-tmp][k] * 2 else: dp[S][k] += dp[tmp][j] * dp[S-tmp][k] * 2 tmp = (tmp-1) & S for k in range(N): print(dp[2**N-1][k])