with open("input.txt") as f:
    line = f.readlines()
for iii in range(0, 5):
    str = ''
    i = 0
    ii = 0
    list1 = []
    D = line[iii]
    D = D.split()
    A = list(D[0])
    B = list(D[1])
    while i < len(A) - 1:
        i = i + 1
        if i > 0:
            if A[i] == A[i-1]:
                A.pop(i)#IMPORTANT
    while ii < len(B) - 1:
        ii = ii + 1
        if ii > 0:
            if B[ii] == B[ii-1]:
                B.pop(ii)
    i = 0
    ii = 0
    while i < len(A) - 1:
        i = i + 1
        if i > 0:
            if A[i] == 'A':
                A.pop(i)
                i = i - 1
            if A[i] == 'E':
                A.pop(i)
                i = i - 1
            if A[i] == 'I':
                A.pop(i)
                i = i - 1
            if A[i] == 'O':
                A.pop(i)
                i = i - 1
            if A[i] == 'U':
                A.pop(i)
                i = i - 1
    while ii < len(B) - 1:
        ii = ii + 1
        if ii > 0:
            if B[ii] == 'A':
                B.pop(ii)
                ii = ii - 1
            if B[ii] == 'E':
                B.pop(ii)
                ii = ii - 1
            if B[ii] == 'I':
                B.pop(ii)
                ii = ii - 1
            if B[ii] == 'O':
                B.pop(ii)
                ii = ii - 1
            if B[ii] == 'U':
                B.pop(ii)
                ii = ii - 1
    i = -1
    if len(A) > len(B):
        U = len(B)
    if len(A) < len(B):
        U = len(A)
    if len(A) == len(B):
        U = len(A)
    while i < U - 1:
        if len(A) > len(B):
            U = len(B)
        if len(A) < len(B):
            U = len(A)
        if len(A) == len(B):
            U = len(A)
        i = i + 1
        if A[i] == B[i]:
            A.pop(i)
            B.pop(i)
            i = i - 1

    A = A[len(A)::-1]
    B = B[len(B)::-1]
    i = -1
    if len(A) > len(B):
        U = len(B)
    if len(A) < len(B):
        U = len(A)
    if len(A) == len(B):
        U = len(A)
    while i < U - 1:
        if len(A) > len(B):
            U = len(B)
        if len(A) < len(B):
            U = len(A)
        if len(A) == len(B):
            U = len(A)
        i = i + 1
        if A[i] == B[i]:
            A.pop(i)
            B.pop(i)
            i = i - 1
    A = A[len(A)::-1]
    B = B[len(B)::-1]



    if len(A) > len(B):
        A = B
    if len(A) == len(B):
        list1.append(A)
        list1.append(B)
        list1.sort()
        A = list1[0]
    A = ''.join(A)

    #print(A)
    with open('output.txt','a+') as f:
      f.write(A+'\n')