import algorithm, math, sequtils, strutils, macros let read* = iterator: string {.closure.} = while true: (for s in stdin.readLine.split: yield s) template input*(T: static[typedesc]): untyped = when T is int: read().parseInt elif T is float: read().parseFloat elif T is string: read() let N, K = input(int) let S = "#" & input(string) if K < N: echo S[K .. N] & S[1 .. K - 1] else: echo S[1 .. N].reversed.join("")