n, k = map(int, input().split()) x = k-1 s = input() print(s[x:]+s[:x])