#include<iostream>
#include<string>
using namespace std;
int main()
{
    string word;
    char cord;
    getline(cin, word);
    cin>>cord;
    if(cord == 'c')
    {
        for(int i = 0; i < word.length(); i++)
        {
            if(word[i] != 'a' && word[i] != 'e' && word[i] != 'i' && word[i] != 'u' && word[i] != 'o' && word[i] != 'y' && word[i] != 'A' && word[i] != 'E' && word[i] != 'I' && word[i] != 'U' && word[i] != 'O' && word[i] != 'Y')
            {
                cout<<word[i];
            }
            else
            {
                cout<<word[i]<<"f"<<word[i];
            }
        }
    }
    else if(cord == 'd')
    {
        for(int i = 0; i < word.length(); i++)
        {
            if(word[i] == 'f')
            {
                i++;
            }
            else
            {
                cout<<word[i];
            }
        }
    }
    return 0;
}
