U = ""
arr = []
lines = input().split(" ")
N = int(lines[0])
K = int(lines[1])
S = input()

if N == 1 && K == 1:
  print(S)
else:
  T = S[::-1]
  
  for i in range(K):
    U += S
    U += T

  num = len(U) 
  arr = [U[j : (j+ N)] for j in range(num) if j + N <= num]        
  arr.sort()
 
  print(arr[0])