s,*t=input().split() s=list(s) t=sorted(list(set(map(int,t)))) for i,u in enumerate(t): del s[u-i] print(''.join(s))