S, *pos = input().split() print("".join([c for i, c in enumerate(S) if not i in map(int, pos)]))