import java.util.Arrays; 
import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class ACSL2Shubay1 {

    public static void main(String args[])  throws IOException {
        
         int iR =0, COUNT = 1;
        String[] inputExpression = new String[COUNT];
        System.out.println("Input: ");
    	while(iR < COUNT){
    		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            inputExpression[iR++] = br.readLine();
        }
        System.out.println("Output: ");
        iR =0;
        while(iR < COUNT){
            String[] wordArray = inputExpression[iR++].split("\\s+");
    		String x = wordArray[0].toLowerCase();
            String y = wordArray[1].toLowerCase();
            //Put the whole array in lowercase
            String c1 =  cleanChars(x.toLowerCase());
            String c2 =  cleanChars(y.toLowerCase());
            //This makes the two strings lowercase
            String output = p(c1,c2);
            System.out.println(x.toUpperCase() + "   " + y.toUpperCase() + "      " + output.toUpperCase());
    	}
      //This is the main string where everything is inputted and printed
    }
        private static String cleanChars(String  s)  
    {
        final StringBuilder output = new StringBuilder();
         Character v[] = { 'a', 'e', 'i', 'o', 'u' };
         //This is a list of the vowels (except y)
        List asL = Arrays.asList(v); 
        for(int i=0;i c2.length()){
            return c2;
        } else{
            int alphaSort = c1.compareTo(c2);
            //Compare the two strings
            if(alphaSort < 0){
                return c1;
            }else{
                return c2;
            }
        } 
      }

    private static String removeChar(String s1,int p){
       StringBuilder sb = new StringBuilder();
       sb.append(s1);
       //Add a character to the delete list
       sb.deleteCharAt(p);
       return sb.toString();
       //Function to delete chars

    }
    
    
}