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.
s = input()
n = int(input())
d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
e = 'abcdefghijklmnopqrstuvwxyz'
for i in s:
    z = ord(i) - ord('a') if ord('a') <= ord(i) and ord(i) <= ord('z') else ord(i) - ord('A')
    if z < n:
        print(d[z], end = '')
    else:
        print(e[z], end = '')