N = int(input()) Q = [] R = [] for _ in range(2**N): *q, r = map(int, input().split()) Q.append(q) R.append(r) if all(R): print('A=⊤') elif not any(R): print('A=⊥') else: A = [] for i in range(2**N): if R[i]: X = [] for j in range(N): if Q[i][j]: X.append('P_' + str(j + 1)) else: X.append('¬P_' + str(j + 1)) A.append('(' + '∧'.join(X) + ')') print('A=' + '∨'.join(A))