for v in range(5):
    x = input('Enter your words: ')
    new_x = x.split(' ')
    #print(new_x[0],new_x[1])
    sy = new_x[0]
    sz = new_x[1]
    #y = []
    #y.append(new_x[0])
    #print(y)
    #x = []

    '''for i in range(1, len(sy), 1):
        if sy[i] == sy[i + 1] or sy[i] == sy[i-1]:
            sy = sy.replace(sy[i], '0')
            print(sy)

        else:
            my_output = ''
            my_output += word[i]
            print(my_output)
    if word[0] != word[1]:
        my_output = word[0] + my_output

    if word[-1] != word[-2]:
        my_output = my_output + word[-1]

    print(my_output)'''

    B = 0
    while(B == 0):
        Boo = False
        for i in range(len(sy)-1):
            #print(len(sy), " ", i, " ", i+1)
            if sy[i] == sy[i+1]:
                sy = sy[0:i] + sy[i+1:]
                if i == sy[0]:
                    sy = sy[1:]
                Boo = True
                break
        if Boo == False:
                break
    #print(sy)

    while(B == 0):
        Boo = False
        for i in range(len(sz)-1):
            #print(len(sy), " ", i, " ", i+1)
            if sz[i] == sz[i+1]:
                sz = sz[0:i] + sz[i+1:]
                if i == sz[0]:
                    sz = sz[1:]
                Boo = True
                break
        if Boo == False:
                break
    #print(sy, ' ', sz)






    vowels = ['A','E','I','O','U', 'a', 'e', 'i', 'o', 'u']
    my_output = ''
    for i in range(1, len(sy)):
        if sy[i:i+1] not in vowels:
            my_output += sy[i:i+1]
    #print(sy[0:1] + my_output)

    vowels = ['A','E','I','O','U', 'a', 'e', 'i', 'o', 'u']
    my_output_ = ''
    for i in range(1, len(sz)):
        if sz[i:i+1] not in vowels:
            my_output_ += sz[i:i+1]
    #print(sy[0:1] + my_output, ' ',sz[0:1] + my_output_)
    sy = sy[0:1] + my_output
    sz = sz[0:1] + my_output_




    length = min(len(sy), len(sz))
    my_y = ''
    my_z = ''
    for i in range(0, length):
        #print(i, sy[i], sz[i] == sz[i])
        if sy[i] != sz[i]:
            my_y += sy[i]
            my_z += sz[i]
    #print(my_y + sy[length:], my_z + sz[length:])
    sy = my_y + sy[length:]
    sz = my_z + sz[length:]


    if (len(sz) > len(sy)):
        sm = sy
        sy = sz
        sz = sm
    length = min(len(sy), len(sz),)
    my_y_ = ''
    my_z_ = ''
    for i in range(0, length):
        #print(i, sy[-i], sz[-i] == sz[-i])
        if sy[-i] != sz[-i]:
            my_y_ += sy[-i]
            my_z_ += sz[-i]
    my_y_ = my_y_[1:]
    my_z_ = my_z_[1:]
    #print(my_y_, " ", my_z_)
    my_y_ = my_y_[::-1]
    my_z_ = my_z_[::-1]
    my_y_ = sy[0:(len(sy)-len(sz))+1] + my_y_
    my_z_ = sz[0:1] + my_z_
    #print("final ", my_y_, " ", my_z_)
    #print(sy[length:] + my_y_ , sz[length:] + my_z_)
    sy = my_y_
    sz = my_z_


    if len(sy) < len(sz):
        print(sy.upper())
    elif len(sz) < len(sy):
        print(sz.upper())
    elif len(sz) == len(sy):
        for i in range(len(sy)):
            #print("i is ", i)
            a1 = ord(sy[i:i+1])
            a2 = ord(sz[i:i+1])
            if a1 > a2:
                print(sz.upper())
                break
            elif a2 > a1:
                print(sy.upper())
                break
print('Thank You')