#include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
int d = s.size() - 2;
if (s == "er" || s == "ly" || s == "ing")
cout << s;
else if (s.find("er", d) == d || s.find("ly", d) == d)
cout << s.substr(0, d);
else if (s.find("ing", d - 1) == d - 1)
cout << s.substr(0, d - 1);
else
cout << s;
return 0;
}