# -----------------------------------------------------------------------------------------
# Oak Valley Coding Club 2019-2020
# Solution for 2020 ACSL Programming Problem #2 – Junior Division
# Author :  Aadit Mathur
# Language: Python 3.x
# -----------------------------------------------------------------------------------------

#-----------------------------------------------
# Main Functions to solve the problem

def eliminateCharacters(N, P):
    vowels = ['A', 'E', 'I', 'O', 'U']
    def deleteDoubleConsonants(B):
        A = list(B)
        n = len(A)
        for i in range(n):
            if((i < n - 1) and (A[i] == A[i + 1]) and (not (A[i] in vowels))):
                A.pop(i)
                n = len(A)
        return ''.join(A)
    def removeVowels(A):
        B = list(A)
        C = [i for i in B if i not in vowels]
        if B[0] in vowels:
            C.insert(0, B[0])
        return ''.join(C)
    #First 2 steps
    step1N = deleteDoubleConsonants(N)
    step1P = deleteDoubleConsonants(P)
    step2N = removeVowels(step1N)
    step2P = removeVowels(step1P)
    #Finds longer one
    if len(step2N) > len(step2P):
        shouldReturnlong = False
        longer = step2N
        shorter = step2P
    elif len(step2N) < len(step2P):
        shouldReturnlong = True
        longer = step2P
        shorter = step2N
    elif len(step2N) == len(step2P):
        shouldReturnlong = True
        longer = step2P
        shorter = step2N
    longerList = list(longer)
    shorterList = list(shorter)
    #left align check
    for i in range(len(shorterList)):
        if shorterList[i] == longerList[i]:
            shorterList[i] = ''
            longerList[i] = ''
    #Stuff for convenience
    longer = ''.join(longerList)
    shorter = ''.join(shorterList)
    if shouldReturnlong:
        step3P = longer
        step3N = shorter
    elif shouldReturnlong == False:
        step3N = longer
        step3P = shorter
    #right align check
    if len(step3N) > len(step3P):
        list3P = list(step3P)
        list3N = list(step3N)
        list3P = list3P[::-1]
        list3N = list3N[::-1]
        for i in range(len(list3P)):
            if list3P[i] == list3N[i]:
                list3N[i] = ''
                list3P[i] = ''
        list3P = list3P[::-1]
        list3N = list3N[::-1]
        if len(list3P) < len(list3N):
            finale = ''.join(list3P)
        elif len(list3P) > len(list3N):
            finale = ''.join(list3N)
        elif len(list3P) == len(list3N):
            mylist = [''.join(list3N), ''.join(list3P)]
            finale = sorted(mylist)[0]
    elif len(step3N) < len(step3P):
        list3P = list(step3P)
        list3N = list(step3N)
        list3P = list3P[::-1]
        list3N = list3N[::-1]
        for i in range(len(list3N)):
            if list3N[i] == list3P[i]:
                list3P[i] = ''
                list3N[i] = ''
        list3P = list3P[::-1]
        list3N = list3N[::-1]
        if len(list3P) < len(list3N):
            finale = ''.join(list3P)
        elif len(list3P) > len(list3N):
            finale = ''.join(list3N)
        elif len(list3P) == len(list3N):
            mylist = [''.join(list3N), ''.join(list3P)]
            finale = sorted(mylist)[0]
    elif len(step3N) == len(step3P):
        list3N = list(step3N)
        list3P = list(step3P)
        list3P = list3P[::-1]
        list3N = list3N[::-1]
        for i in range(len(list3N)):
            if list3N[i] == list3P[i]:
                list3N[i] = ''
                list3P[i] = ''
        list3P = list3P[::-1]
        list3N = list3N[::-1]
        if len(list3P) < len(list3N):
            finale = ''.join(list3P)
        elif len(list3P) > len(list3N):
            finale = ''.join(list3N)
        elif len(list3P) == len(list3N):
            mylist = [''.join(list3N), ''.join(list3P)]
            finale = sorted(mylist)[0]
    return finale


#-----------------------------------------------
# Auxiliary code for reading input and writing output
input = 'input.txt'
output = 'output.txt'

def readinput():
  words=[]
  with open(input) as f:
    lines = f.readlines()
    for line in lines:
      if line.split()!=[]:
        words.append(line.split())

  for j in range (0,len(words)):
    for i in range(0,len(words[j])):
      words[j][i]=(words[j][i])

  return words


def writeoutput(line):
  with open(output,'a') as f:
     f.write(str(line)+'\n')

def clearoutput():
  f=open(output,'w')
  f.write('')

allinputs = readinput()

clearoutput()
for line in allinputs:
    S1 = line[0]
    S2 = line[1]
    writeoutput(eliminateCharacters(S1, S2))
    print(eliminateCharacters(S1,S2))