S = input() left = -1 for i in range(len(S)): if S[i] == "#": left = i break right = -1 for i in reversed(range(len(S))): if S[i] == "#": right = i break print(S[left+1:right])