import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Scanner;

public class Haiku_sjz {
	
	private static final int MaxLineLength = 200;
	private BufferedReader input;

	public Haiku_sjz(BufferedReader input) {
		this.input = input;
	}

	public static void main(String[] args) throws FileNotFoundException, IOException {
		if (args.length > 0) {
			try (BufferedReader input 
					= new BufferedReader(new FileReader(args[0])))
			{
				new Haiku_sjz(input).solve();
			}
		} else {
			BufferedReader input 
			    = new BufferedReader (new InputStreamReader(System.in));
			new Haiku_sjz(input).solve();
		}

	}

	private void solve() throws IOException {
		String line = input.readLine();
		solveOne (line);
	}

	private void solveOne(String line) throws IOException {
		ArrayList<String> words = new ArrayList<>();
		collectWords(line, words);
		int[] syllables = new int[words.size()];
		countSyllables (words, syllables);
		if (canBeHaiku(syllables)) {
			printAsHaiku (words, syllables); 
		} else {
			System.out.println(line);
		}
	}

	private void printAsHaiku(ArrayList<String> words, int[] syllables) {
		int syllableCount = 0;
		for (int i = 0; i < words.size(); ++i) {
			if (syllableCount == 5 && syllables[i] > 0) {
				System.out.println();
			} else if (syllableCount == 12 && syllables[i] > 0) {
				System.out.println();
			} else if (i > 0) {
				System.out.print(' ');
			}
			System.out.print(words.get(i));
			syllableCount += syllables[i];
		}
		System.out.println();
	}

	private boolean canBeHaiku(int[] syllables) {
		// Some prefix must add up to 5
		// Some prefix must add to 12
		// The total must be 17.
		
		boolean found5 = false;
		boolean found12 = false; 
		int sum = 0;
		for (int c: syllables) {
			sum += c;
			if (sum == 5)
				found5 = true;
			if (sum == 12)
				found12 = true;
		}
		return (sum == 17 && found5 && found12);
	}

	
	private void countSyllables(ArrayList<String> words, int[] syllables) {
		for (int i = 0; i < words.size(); ++i) {
			syllables[i] = countSyllables(words.get(i));
		}
	}

	private int countSyllables(String word) {
		// First, trim the string down according to the various special rules
		word = trimNonAlphabetics(word);
		word = word.toLowerCase();
		word = reduceQU(word);
		word = reduceConsonantY(word);
		word = reduceSilentE(word);
		word = reduceES(word);
		int count = 0;
		boolean seenAVowel = false;
		for (int pos = 0; pos < word.length(); ++pos) {
			char c = word.charAt(pos);
			if (isAVowel(c)) {
				if (!seenAVowel) {
					++count;
				}
				seenAVowel = true;
			} else {
				seenAVowel = false;
			}
		}
		if (count == 0) {
			count = 1;
		}
		return count;
	}

	/**
	 * Remove non-alphabetic characters from the end of the string.
	 * @param word
	 * @return trimmed word
	 */
	private String trimNonAlphabetics(String word) {
		int trueStart = 0;
		int trueEnd = word.length();;
		while (trueEnd <= word.length() &&
			   !Character.isAlphabetic(word.charAt(trueEnd-1))) {
			--trueEnd;
		}
		return word.substring(trueStart,  trueEnd);
	}

	private boolean isAVowel(char c) {
		switch (c){
		case 'a':
		case 'e':
		case 'i':
		case 'o':
		case 'u':
		case 'y':
		case 'A':
		case 'E':
		case 'I':
		case 'O':
		case 'U':
		case 'Y':
			return true;
		default:
			return false;
		}
	}

	/**
	 * If the words ends in 'e' not preceded by 
	 * consonant-L, then remove the e to prevent the preceding
	 * consonants from being treated as a syllable separator. 
	 * @param word
	 * @return
	 */
	private String reduceSilentE(String word) {
		if (word.charAt(word.length()-1) != 'e')
			return word;
		if (word.length() < 3)
			// Trim final e
			return word.substring(0, word.length()-1);
		char lastM1 = word.charAt(word.length()-2);
		if (lastM1 == 'l') {
			char lastM2 = word.charAt(word.length()-3);
			if (isAVowel(lastM2)) {
				// trim final e
				return word.substring(0, word.length()-1);
			} else {
				return word;
			}
		} else {
			// trim final e
			return word.substring(0, word.length()-1);			
		}
	}

	
	/**
	 * If the words ends in 'es' not preceded by a pair of 
	 * consonants-L, then remove the "es" to prevent it being
	 * as a separate syllable.
	 * 
	 * @param word
	 * @return word with insignificant es endings trimmed
	 */
	private String reduceES(String word) {
		if (word.length() < 3)
			return word;
		if ("es".equals(word.substring(word.length()-2))) {
			if (word.length() > 3) {
				char c1 = word.charAt(word.length()-3);
				char c2 = word.charAt(word.length()-4);
				if (isAVowel(c1) || isAVowel(c2)) {
					return word.substring(0, word.length()-2);
				} else {
					// Both preceding characters are consonants. Trim the 'es'.
					return word;
				}
			} else {
				return word;
			}
		} else {
			return word;
		}
	}
	
	
	
	
	
	/**
	 * Any instances of y followed by another vowel are
	 * treated as consonants. Replace such y's by a character that is
	 * unambiguously a consonant.
	 * 
	 * @param word
	 * @return word with consonant y's replaced by x's 
	 */
	private String reduceConsonantY(String word) {
		String result = word.replaceAll("y([aeiou])", "x\\1");
		return result;
	}

	/**
	 * Replace qu by q so that the u is not counted as a vowel.
	 * @param word
	 * @return trimmed word
	 */
	private String reduceQU(String word) {
		String result = word.toLowerCase();
		return result.replace("qu", "q");
	}

	private void collectWords(
			String line,
			ArrayList<String> words) throws IOException {
		int pos = 0;
		if (line.length() > MaxLineLength) {
				throw new IOException("Illegal input case: overly long line\n   " + line);
		}
		Scanner lineIn = new Scanner (line);
		while (lineIn.hasNext()) {
			StringBuilder buf = new StringBuilder();
			String nextWord = lineIn.next();
			if (! nextWord.matches("[-a-zA-z][-a-zA-z]*[^-a-zA-z]*")) {
				throw new IOException("Illegal input case: bad word "
									  + nextWord + " in \n   "
									  + line);
			}
			words.add(nextWord);
		}
	}

	private boolean isAWordChar(char charAt) {
		return Character.isAlphabetic(charAt)
				|| charAt == '-';
	}

}
