#include <iostream>
#include <cstring>
using namespace std;
const int MAX_SIZE = 2000;
const int TOTAL_WORDS = 285;
const int TOTAL_LETTERS = 6;
void interchangeWords(char firstWord[], char secondWord[]) {
char aux[TOTAL_LETTERS + 1] = {0};
strcpy(aux, firstWord);
strcpy(firstWord, secondWord);
strcpy(secondWord, aux);
}
void sortLyrics(char lyrics[][TOTAL_LETTERS + 1]) {
for (int i = 0; lyrics[i]; ++i) {
for (int j = i + 1; lyrics[j]; ++j) {
if (strcmp(lyrics[i], lyrics[j]) > 0) {
interchangeWords(lyrics[i], lyrics[j]);
}
}
}
}
bool isLetter(char c) {
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
bool isVowel(char c) {
const int CASE_DIFFERENCE = 'a' - 'A';
const char allLowerVowels[] = "aeiou";
for (int i = 0; allLowerVowels[i]; ++i) {
if (c == allLowerVowels[i] || c == allLowerVowels[i] - CASE_DIFFERENCE) {
return true;
}
}
return false;
}
int totalVowels(const char currentWord[]) {
int numVowels = 0;
for (int i = 0; currentWord[i]; ++i) {
if (isVowel(currentWord[i])) {
++numVowels;
}
}
return numVowels;
}
bool requiredLyric(const char currentWord[]) {
return strlen(currentWord) == TOTAL_LETTERS && totalVowels(currentWord) > 2;
}
void storeLyrics(char lyrics[][TOTAL_LETTERS + 1], int &totalLyrics, const char text[]) {
char currentWord[MAX_SIZE + 1] = {0};
bool wasLetter = false;
int lenghtText = strlen(text);
for (int i = 0; i <= lenghtText; ++i) {
if (isLetter(text[i])) {
char currentLetter[] = {text[i], 0};
strcat(currentWord, currentLetter);
wasLetter = true;
} else if (wasLetter) {
if (requiredLyric(currentWord)) {
strcpy(lyrics[totalLyrics], currentWord);
++totalLyrics;
}
currentWord[0] = 0;
wasLetter = false;
}
}
}
int main() {
char text[MAX_SIZE + 1], lyrics[TOTAL_WORDS][TOTAL_LETTERS + 1];
int totalLyrics = 0;
while (cin.getline(text, MAX_SIZE + 1)) {
storeLyrics(lyrics, totalLyrics, text);
}
sortLyrics(lyrics);
for (int i = 0; lyrics[i][0]; ++i) {
cout << lyrics[i] << '\n';
}
return 0;
}