import strutils, sequtils proc f(s: string) :int = result = s.parseInt - 1 var nm = stdin.readLine.split n = nm[0].parseInt m = nm[1].parseInt a = stdin.readLine.split.map(f) stk = newSeqWith(n, 0) for i in 0..