s = input() r = [] f = 0 for i in range(len(s)): if s[i] == "#": f ^= 1 else: if f: r.append(s[i]) print("".join(r))