#include<iostream>
#include<cstring>
using namespace std;
bool glasna (long long a)
{
    if (a=='a' || a=='e' || a=='i' || a=='o' || a=='u' || a=='y' || a=='A' || a=='E' || a=='I' || a=='O' || a=='U' || a=='Y') {return true;}
    else {return false;}
}
int main ()
{
    string a;
    char nachin;

    cin>>a;
    cin>>nachin;

    if (nachin=='c')
    {
        for (long long i=0; i<a.size(); i++)
        {
            long long c=a[i];
            if (glasna(c)==true) {cout<<char(c)<<"f"<<char(c);}
            else {cout<<char(c);}
        }
    }
    else
    {
        long long i=0;
        while (i<a.size())
        {
            long long c=a[i];
            if (glasna(c)==true) {cout<<char(c); i=i+3;}
            else {cout<<char(c); i++;}
        }
    }
    return 0;
}
