import java.util.Scanner;

class RealEstate {


  public static String generateAdvertisement(String str) {
    if (str.length()  == 0)
      throw new IllegalArgumentException("Please enter a valid phrase");

    // split the input string into a list of words 

    String[] words = str.split(" ");
    String newStr = "";
  
    // loop through each word 
    for (int i = 0;i < words.length;i++) {
      String currentWord = words[i];

      // loop through each letter - execpt the first - always accept 
      // the first letter of a word, even if it is a vowel
      newStr += currentWord.charAt(0); 
      for (int k = 1;k < currentWord.length();k++) {
        char currentLetter = currentWord.charAt(k);
        if (!isVowel(currentLetter))
          newStr += currentLetter;
      }
      newStr += " ";
    }
    return newStr;
  }

  
public static void prtc(String s) {

     int index=1;
     System.out.println("The length of s = " + s.length()+"\n\n");
     if (s.length() > 0)
        System.out.print(s.charAt(0)); // print the first character, if there is one

     while (index < s.length()) {
         if (s.charAt(index) == ' ') { // print the space, and next char if there is one 
            System.out.print(s.charAt(index));
            if (index < s.length())
               System.out.print(s.charAt(index+1));
               index++;  // skip the next character 
            }
        else { // print constants only 
           if (!isVowel(s.charAt(index)))
              System.out.print(s.charAt(index));
             }
        index++;
        }
     System.out.println();
}


  public static boolean isVowel(char Letter) {
    return Letter == 'a' ||
           Letter == 'e' ||
           Letter == 'i' ||
           Letter == 'o' ||
           Letter == 'u';
  }

  public static void main(String[] args) {
    Scanner keyboard = new Scanner(System.in);
    System.out.println("Input the text you wish to Real Estatify");
    System.out.println();
    System.out.println("Example: ");
    System.out.print("'Desirable unfurnished flat in quiet residential area' is: ");
    System.out.println(generateAdvertisement("Desirable unfurnished flat in quiet residential area"));
    System.out.println("\n Enter text now: ");

    String input = keyboard.nextLine();
    String output = generateAdvertisement(input);
    System.out.println("Output is: \n" + output);
    prtc(input);
  }
}