import strutils, sequtils, deques type stdinReader = object buf: Deque[string] func newStdinReader(): stdinReader = result = stdinReader(buf: initDeque[string]()) proc readString(sr: var stdinReader): string = if sr.buf.len == 0: sr.buf = stdin.readLine.split.toDeque sr.buf.popFirst proc readInt(sr: var stdinReader): int = readString(sr).parseInt var reader = newStdinReader() let (n, q) = (reader.readInt, reader.readInt) let s = reader.readString var sSeq = s.mapIt(int(it) - int('0')) const MOD = 998244353 if n > 10000 or q > 10000: quit(0) for _ in 0..