#include<bits/stdc++.h>
using namespace std;
string s,he,hs;
int siz;
int main(){
cin>>s;
siz=s.size()-1;
he=s[siz-1]+s[siz];
hs=s[siz-2]+s[siz-1]+s[siz];
if(he=="er"||he=="ly") s.erase(siz-1,2);
else if(hs=="ing") s.erase(siz-2,3);
cout<<s;
return 0;
}