S = input() left = S.find('#') right = S.rfind('#') ans = S[left+1:right] print(ans)