template times*(n:int,body) = (for _ in 0.." .} proc printf(formatstr: cstring){.header: "", varargs.} proc putchar_unlocked(c:char){. importc:"putchar_unlocked",header: "" .} proc scanf(formatstr: cstring){.header: "", varargs.} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord var S : array[1_00010,char] proc reduce(x,y,size:int) = if x == -1: for i in 0.. 126 : reduce(x,y,i) putchar_unlocked('\n') return let isAlpha = k < '0' or '9' < k if not isAlpha: y = i if preIsAlpha : x = i S[i] = k i += 1 preIsAlpha = isAlpha scan().times: impl()