s=input() l=list(map(int,input().split())) for i in range(len(s)): if i in l: print(s[i].upper(),end='') else: print(s[i],end='')