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

public class ACSL2NiyatiKottury {
  
    public static void main(String args[])  throws IOException {
        
         int inputRow =0, COUNT = 1;
        String[] inputExpression = new String[COUNT];
        System.out.println("Input: ");
    	while(inputRow < COUNT){
    		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            inputExpression[inputRow++] = br.readLine();
        }
        System.out.println("Output: ");
        inputRow =0;
        while(inputRow < COUNT){
            String[] wordArray = inputExpression[inputRow++].split("\\s+");
    		String x = wordArray[0].toLowerCase();
            String y = wordArray[1].toLowerCase();
            String cStr1 =  cleanChars(x.toLowerCase());
            String cStr2 =  cleanChars(y.toLowerCase());
            String output = process(cStr1,cStr2);
            System.out.println(x.toUpperCase() + "   " + y.toUpperCase() + "      " + output.toUpperCase());
    	}
    }
    private static String  process(String cStr1, String cStr2){
          StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();
        for(int i=0;i cStr2.length()){
            return cStr2;
        } else{
            int alphaSort = cStr1.compareTo(cStr2);
            if(alphaSort < 0){
                return cStr1;
            }else{
                return cStr2;
            }
        } 
      }
    private static String cleanChars(String  s)  
    {
        final StringBuilder output = new StringBuilder();
         Character vowels[] = { 'a', 'e', 'i', 'o', 'u' };
        List asL = Arrays.asList(vowels); 
        for(int i=0;i