import algorithm, sequtils, strutils var n: int = stdin.readline.parseInt a: seq[seq[int]] = mapIt(0.. 0: var tmp: seq[int] for i in 0..