import sequtils,strutils,strformat,times template times*(n:int,body) = (for _ in 0.." ,discardable.} proc scan(): int = while true: let k = getchar_unlocked() if k < '0' : return result = 10 * result + k.ord - '0'.ord proc scanchar():char = result = getchar_unlocked() discard getchar_unlocked() let n = scan() var Q = newSeq[string]() stopwatch: var arr = newSeq[int](n+1) (^^n).times: for i in 0..n: arr[i] = scan() if arr[^1] == 0 : continue var ans = newSeq[string]() for j in 0..