The first line of the input is a string (between 1 and 50 characters long, inclusive). Each character will be a letter of English alphabet, lowercase or uppercase.

The second line of the input is an integer between 0 and 26, inclusive.
x = "abcdefghijklmnopqrstuvwxyz"
X = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
z = list(input())
n = int(input())
for i in range(len(z)):
    if(z[i] in x):
        k = x.index(z[i]) + 1
    else:
        k = X.index(z[i]) + 1
    if(k < n):
        z[i] = z[i].upper()
    else:
        z[i] = z[i].lower()
ans = "".join(z)
print(ans)