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

for i in range(K):
    U += S
    U += T

num = len(U)

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

print(arr[0])
