func main() var n: int :: cui@input().toInt(&) var nn: int :: 2 ^ n var q: [][]int :: #[nn, n]int var r: []int :: #[nn]int var ss: [][]char for i(0, nn - 1) do ss :: cui@input().split(" ") for j(0, n - 1) do q[i][j] :: ss[j].toInt(&) end for do r[i] :: ss[n].toInt(&) end for var cnt: int :: 0 for i(0, nn - 1) do cnt :+ r[i] end for if(cnt = 0) do cui@print("A=⊥\n") elif(cnt = nn) do cui@print("A=⊤\n") else do cui@print("A=") var f: bool :: false for i(0, nn - 1) if(r[i] = 1) if(f) do cui@print("∨") end if do cui@print("(") for j(0, n - 1) do cui@print("\{q[i][j] = 1 ?("", "¬")}P_\{j + 1}\{j = n - 1 ?(")", "∧")}") end for do f :: true end if end for do cui@print("\n") end if end func