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