import sequtils,strutils,strformat 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]() (^^n).times: let arr = newSeqWith(n+1,scan()) if arr[^1] == 0 : continue var ans = newSeq[string]() for j in 0..