import strutils, sequtils let N = stdin.readline.parseInt K = stdin.readline.split.map(parseInt) var dp = newSeqWith(1 shl N, -1) proc is_kadomatsu(A, B, C: int): bool = return A != B and B != C and C != A and (max(A, C) < B or min(A, C) > B) proc dpdp(state: int): int = if dp[state] != -1: return dp[state] for i in 0..