@staticmethod
def c():
    (n, k) = map(int, sys.stdin.readline().split())
    s = list(sys.stdin.readline().rstrip())
    cost = ([1] * n)
    r = k
    for i in range((n - 1)):
        q = []
        for j in range((i + 1), n):
            if ((s[j] < s[i]) and ((cost[i] + cost[j]) <= r)):
                heappush(q, (s[j], (cost[i] + cost[j]), (- j)))
        if (not q):
            continue
        (_, c, j) = heappop(q)
        j = (- j)
        (s[i], s[j]) = (s[j], s[i])
        r -= c
        cost[i] = cost[j] = 0
    print(''.join(s))
@staticmethod
def c():
    (n, k) = map(int, sys.stdin.readline().split())
    s = list(sys.stdin.readline().rstrip())
    cost = ([1] * n)
    r = k
    for i in range((n - 1)):
        q = []
        for j in range((i + 1), n):
            if ((s[j] < s[i]) and ((cost[i] + cost[j]) <= r)):
                heappush(q, (s[j], (cost[i] + cost[j]), (- j)))
        if (not q):
            continue
        (_, c, j) = heappop(q)
        j = (- j)
        (s[i], s[j]) = (s[j], s[i])
        r -= c
        cost[i] = cost[j] = 0
    print(.join(s))