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

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

def eliminate(S1,S2):
    L1 = list(S1)
    L2 = list(S2)
    #remove double consonants
    commonL1 = ''
    commonL2 = ''
    x = 0
    while True:
        if x >= len(L1):
            break
        if L1[x] not in ['A','E','I','O','U']:
            if L1[x]  == commonL1:
                L1.pop(x)
                x = x -1
            else:
                commonL1 = L1[x]
        else:
            commonL1 = ''
                
        x = x + 1
    x = 0    
    while True:
        if x >= len(L2):
            break
        if L2[x] not in ['A','E','I','O','U']:
            if L2[x] == commonL2:
                L2.pop(x)
                x = x - 1
            else:
                commonL2 = L2[x]
        else:
            commonL2 = ''
                
        x = x + 1
    print(L1," ",L2," Double consonants")
    #remove all vowels unless it is the first character of the string
    L1[:] = [L1[0]]+[x for x in L1[1:len(L1)] if x not in ['A','E','I','O','U']]
    L2[:] = [L2[0]]+[x for x in L2[1:len(L2)] if x not in ['A','E','I','O','U']]
    print(L1," ",L2," Vowels")

    #remove letters from Left to Right
    x = 0
    while True:
        if x >= len(L1) or x >= len(L2):
            break
        if L1[x] == L2[x]:
            L2.pop(x)
            L1.pop(x)
            x = x-1
        x = x + 1
    print(L1," ",L2," L-R Removal")

    #remove letters from Right to Left
    x = 1
    while True:
        if x >= len(L1) or x >= len(L2):
            break
        if L1[-x] == L2[-x]:
            L2.pop(-x)
            L1.pop(-x)
            x = x-1
        x = x + 1
    print(L1," ",L2," R-L Removal")
    S = ''
    if len(L1) > len(L2):
        S = "".join(L2)
    elif len(L1) < len(L2):
        S = "".join(L1)
    elif len(L1) == len(L2):
        S = ''.join(sorted(list([L1,L2]))[0])
    return S



#-----------------------------------------------
# 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(eliminate(S1, S2))
    print(eliminate(S1,S2))