import sequtils proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" ,discardable.} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': return result = 10 * result + k.ord - '0'.ord let n = scan() proc toI(x,y:int):int = x * 10 + y var poses = @[toI(2,8),toI(3,9),toI(7,9)] for _ in 0..