The input contains between 1 and 10 lines, *i*-th line contains an integer number *x*<sub class="lower-index">*i*</sub> (0 ≤ *x*<sub class="lower-index">*i*</sub> ≤ 9).
s=input()
n=int(input())
ans=""
for i in range(len(s)):
    x=s[i]
    if(ord(x)<n+97):
        ans+=x.upper()
    else:
        ans+=x.lower()
print(ans)
