#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); string S; cin >> S; while(S.back() != '#') S.pop_back(); S.pop_back(); reverse(S.begin(), S.end()); while(S.back() != '#') S.pop_back(); S.pop_back(); reverse(S.begin(), S.end()); cout << S << endl; return 0; }