#include using namespace std; int main() { int N; scanf("%d", &N); vector> S(N, vector(N)); for (auto &y : S) for (int &x : y) scanf("%d", &x); vector> DP(1 << N, vector(N)); for (int i = 0; i < N; i++) DP[1 << i][i] = 1; for (int k = 2; k <= N; k *= 2) for (int i = 1; i < (1 << N); i++) if (popcount((unsigned)i) == k) { for (int j = 0; (j = (j - i) & i);) if (j > i - j && popcount((unsigned)j) == k / 2) { for (int x = 0; x < N; x++) for (int y = 0; y < N; y++) if (S[x][y]) DP[i][x] += 2 * DP[j][x] * DP[i - j][y]; else DP[i][y] += 2 * DP[j][x] * DP[i - j][y]; } } for (auto y : DP.back()) cout << y << endl; }