def isVowel(ch):
    return ch == 'A' or ch == 'E' or ch == 'I' or ch == 'O' or ch == 'U'

#taking the input
input0 = input().split()
str1 = input0[0]
str2 = input0[1]

#step 1 - locate double consonants. delete it if there are two in a row
def DoubleConsonant(stri):
    output = ''
    i = 0
    while i < len(stri):
        ch = stri[i]
        output += ch
        if (ch == 'A' or ch == 'E' or ch == 'I' or ch == 'O' or ch == 'U'):
            i += 1
        elif ( i < len(stri) - 1 and ch == stri[i + 1]):
            i += 2
        else:
            i += 1
    return output

#step 2 - check characters 0 and on. delete vowels
def ByeVowels(stri):
    output = stri[0]
    i = 1
    while i < len(stri):
        ch = stri[i]
        i += 1
        if (not isVowel(ch)):
            output += ch
    return output

#steps 3 and 4 -align the strings and delete letters in like positions
def Reposition(stra, strb):
    count = min(len(stra),len(strb))

    temp1 = ''
    temp2 = ''
    for i in range(count):
        if (stra[i] != strb[i]):
            temp1 += stra[i]
            temp2 += strb[i]
    if (len(stra) > count):
        temp1 += stra[count:]
    if (len(strb) > count):
        temp2 += strb[count:]
    return temp1 + ' ' + temp2

#step 1 outputs
str1 = DoubleConsonant(str1)
str2 = DoubleConsonant(str2)

#step 2 outputs
str1 = ByeVowels(str1)
str2 = ByeVowels(str2)

#step 3 outputs
result = Reposition(str1, str2).split()
str1 = result[0]
str2 = result[1]

#step 4 outputs
# reverse string first
str1 = str1[len(str1)::-1]
str2 = str2[len(str2)::-1]
result = Reposition(str1, str2).split()
str1 = result[0]
str2 = result[1]
# reverse string again
str1 = str1[len(str1)::-1]
str2 = str2[len(str2)::-1]

#final output
if (len(str1) < len(str2)):
    print(str1)
elif (len(str1) > len(str2)):
    print(str2)
else:
    print(min(str1, str2))