import sequtils,strutils var N = stdin.readline.parseInt ans = newSeq[int](0) Ls = newSeqWith(1005, newSeq[int](0)) cnt = 0 for n in 0..