// Program 27: Words with More Than Two Vowels import java.util.*; class VowelWordOrder { static int count(String s) { int total = 0; for (int i = 0; i < s.length(); i++) { char ch = Character.toUpperCase(s.charAt(i)); if ("AEIOU".indexOf(ch) >= 0) { total++; } } return total; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] input = sc.nextLine().trim().split(" +"); String[] selected = new String[input.length]; int[] totals = new int[input.length]; int size = 0; for (String word : input) { int vowels = count(word); if (vowels > 2) { selected[size] = word; totals[size++] = vowels; } } for (int i = 1; i < size; i++) { String key = selected[i]; int total = totals[i]; int j = i - 1; while (j >= 0 && totals[j] > total) { selected[j + 1] = selected[j]; totals[j + 1] = totals[j]; j--; } selected[j + 1] = key; totals[j + 1] = total; } for (int i = 0; i < size; i++) { System.out.println(selected[i] + " : " + totals[i]); } } }