import sequtils, strutils let xs = stdin.readLine.split.map parseInt h = xs[0] n = xs[1] hs = n.pred.newSeqWith parseInt readLine stdin var cnt = 1 for v in hs: if v > h: inc cnt let s = case cnt mod 10 of 1: "st" of 2: "nd" of 3: "rd" else: "th" echo cnt, s