for J in range(5):
    str_input = input('Enter a string:')
    word1, word2 = str_input.split()
    #print(word1, word2)
    my_output = ''
    for i in range(1,len(word1)-1):
        if (word1[i] not in ('A','E','I','O','U')) and (word1[i]  == word1[i + 1]):
            #print(i, word1[i], ' is removed')
            continue
        else:
            my_output += word1[i]
            #print(i, word1[i], my_output)
    if word1[0] != word1[1]:
        my_output = word1[0] + my_output

    if word1[-1] != word1[-2]:
        my_output = my_output + word1[-1]
    #print(my_output)
    my_output2 = ''
    for i in range(1,len(word2)-1):
        if (word2[i] not in ('A','E','I','O','U')) and (word2[i]  == word2[i + 1]):
            #print(i, word2[i], ' is removed')
            continue
        else:
            my_output2 += word2[i]
            #print(i, word2[i], my_output2)
    if word2[0] != word2[1]:
        my_output2 = word2[0] + my_output2

    if word2[-1] != word2[-2]:
        my_output2 = my_output2 + word2[-1]
    vowels = 'AEIOU'
    my_str = ''
    for i in range(len(my_output)):
#print(i,user_input[i], my_str)
        if i == 0:
            my_str += my_output[i]
        else:
            if my_output[i] in vowels:
                continue
            else:
                my_str += my_output[i]
#print(my_str)
#print(i, user_input[i], my_str)
    my_str2 = ''
    i = ''
    for i in range(len(my_output2)):
#print(i,user_input[i], my_str)
        if i == 0:
            my_str2 += my_output2[i]
        else:
            if my_output2[i] in vowels:
                continue
            else:
                my_str2 += my_output2[i]
#print(my_str2)
#print(my_str, my_str2)
    length  = min(len(my_str), len(my_str2))
    my_x = ''
    my_y = ''
    for i in range(length):
    #print(i, x[i], y[i], x[i] == y[i])
        if my_str[i] != my_str2[i]:
            my_x += my_str[i]
            my_y += my_str2[i]
            left_right2 = my_y + my_str2[length:]
            left_right = my_x + my_str[length:]
#print(left_right2, left_right)
    length = min(len(left_right), len(left_right2))
    str1 = ''
    str2 = ''
    for i in range(1,length+1):
 #print(-i, input_list[0][-i], input_list[1][-i])
     if left_right[-i] == left_right2[-i]:
 #print(-i, f'The letter {input_list[0][-i]} matches and is skipped')
         continue
     else:
         str1 += left_right[-i]
         str2 += left_right2[-i]
 #print(-i, str1, str2)
    str1 = str1[::-1]
    str2 = str2[::-1]
    right_left = left_right[0:len(left_right) - length] + str1
    right_left2 = left_right2[0:len(left_right2) - length] + str2
#print(right_left , right_left2)
    if len(right_left) < len(right_left2):
        print(right_left)
    elif len(right_left2) < len(right_left):
        print(right_left2)
    else:
        output_list = [right_left, right_left2]
        output_list.sort()
        print(output_list[0])