#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
char s[100];
char ar[10001]= {};
cin>>s;
for(int i=0,j=0; s[i]!='\0'; i++)
{
if(s[i]=='A'||s[i]=='E'||s[i]=='K'||s[i]=='O'||s[i]=='U'||s[i]=='a'||s[i]=='e'||s[i]=='k'||s[i]=='o'||s[i]=='u')
{
if(s[i]>='a'&&s[i]<='z')
ar[j++]=s[i]-32;
else
ar[j++]=s[i];
ar[j++]='#';
ar[j++]='#';
}
else
{
continue;
}
}
for(int i=0; ar[i]!='\0'; i++)
{
cout<<ar[i];
}
cout<<endl;
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKQp7CiAgICBpbnQgdDsKICAgIGNpbj4+dDsKICAgIHdoaWxlKHQtLSkKICAgIHsKICAgICAgICBjaGFyIHNbMTAwXTsKICAgICAgICBjaGFyIGFyWzEwMDAxXT0ge307CiAgICAgICAgCiAgICAgICAgY2luPj5zOwoKICAgICAgICBmb3IoaW50IGk9MCxqPTA7IHNbaV0hPSdcMCc7IGkrKykKICAgICAgICB7CiAgICAgICAgICAgIGlmKHNbaV09PSdBJ3x8c1tpXT09J0UnfHxzW2ldPT0nSyd8fHNbaV09PSdPJ3x8c1tpXT09J1UnfHxzW2ldPT0nYSd8fHNbaV09PSdlJ3x8c1tpXT09J2snfHxzW2ldPT0nbyd8fHNbaV09PSd1JykKICAgICAgICAgICAgewoKICAgICAgICAgICAgICAgIGlmKHNbaV0+PSdhJyYmc1tpXTw9J3onKQogICAgICAgICAgICAgICAgICAgIGFyW2orK109c1tpXS0zMjsKICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICBhcltqKytdPXNbaV07CiAgICAgICAgICAgICAgICBhcltqKytdPScjJzsKICAgICAgICAgICAgICAgIGFyW2orK109JyMnOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZm9yKGludCBpPTA7IGFyW2ldIT0nXDAnOyBpKyspCiAgICAgICAgewogICAgICAgICAgICBjb3V0PDxhcltpXTsKICAgICAgICB9CiAgICAgICAgY291dDw8ZW5kbDsKICAgIH0KCiAgICByZXR1cm4gMDsKfQo=