n, k = map(int, input().split())
s = input()
l = (n + k - 1) // k
c = n % k
if c == 0:
c = k
s = sorted(s)
ptr = 0
for _ in range(l):
cc = 0
for j in range(c):
if j != 0 and s[ptr] == s[ptr - 1]:
cc += 1
else:
cc = 1
ptr += 1
c = cc
print(s[ptr - 1], end='')