#include <iostream>
using namespace std;
int main(){
string s;
getline(cin,s);
int end = s.length()-1;
if((s[end] == 'r' && s[end-1] == 'e') || (s[end] == 'y' && s[end-1] == 'l') || (s[end] == 'g' && s[end-1] == 'n' && s[end-2] == 'i')){
if(s[end] == 'g' && s[end-1] == 'n' && s[end-2] == 'i'){
s.erase(end-2,3);
}else{
s.erase(end-1,2);
}
}
cout << s;
return 0;
}