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.
a=input()
b=int(input())
g=a.lower()
al='abcdefghijklmnopqrstuvwxyz'
for i in range(len(a)):
    p=al.index(g[i])
    if p<b:
        a=a[:i]+a[i].upper()+a[i+1:]
print(a)