#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int counter(string a){
int c = 0;
for (unsigned int i = 0; i < a.length(); i++){
if (a[i]=='e'||'u'==a[i]||'o'==a[i]||'i'==a[i]||'a'==a[i]){
c++;
}
}
return c;
}
bool mod(string a, string b){
return counter(a) > counter(b);
}
int main() {
vector <string> Words;
string word;
for (unsigned int i=0; cin >> word; i++){
Words.push_back(word);
}
sort(Words.begin(),Words.end(), mod);
for(auto i: Words){
cout << i <<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBjb3VudGVyKHN0cmluZyBhKXsKCWludCBjID0gMDsKCWZvciAodW5zaWduZWQgaW50IGkgPSAwOyBpIDwgYS5sZW5ndGgoKTsgaSsrKXsKCQlpZiAoYVtpXT09J2UnfHwndSc9PWFbaV18fCdvJz09YVtpXXx8J2knPT1hW2ldfHwnYSc9PWFbaV0pewoJCQljKys7CgkJfQoJfQoJcmV0dXJuIGM7Cn0KCWJvb2wgbW9kKHN0cmluZyBhLCBzdHJpbmcgYil7CglyZXR1cm4gY291bnRlcihhKSA+ICBjb3VudGVyKGIpOwp9CglpbnQgbWFpbigpIHsKCQl2ZWN0b3IgPHN0cmluZz4gV29yZHM7CgkJc3RyaW5nIHdvcmQ7CgkJZm9yICh1bnNpZ25lZCBpbnQgaT0wOyBjaW4gPj4gd29yZDsgaSsrKXsKCQkJV29yZHMucHVzaF9iYWNrKHdvcmQpOwoJCX0KCQkJc29ydChXb3Jkcy5iZWdpbigpLFdvcmRzLmVuZCgpLCBtb2QpOwoJCQlmb3IoYXV0byBpOiBXb3Jkcyl7CgkJCWNvdXQgPDwgaSA8PGVuZGw7CgkJfQoJcmV0dXJuIDA7Cn0=