You are given $n$ words, each of which consists of lowercase alphabet letters. Each word contains at least one vowel. You are going to choose some of the given words and make as many beautiful lyrics as possible.

Each lyric consists of two lines. Each line consists of two words separated by whitespace. 

A lyric is beautiful if and only if it satisfies all conditions below.   The number of vowels in the first word of the first line is the same as the number of vowels in the first word of the second line.  The number of vowels in the second word of the first line is the same as the number of vowels in the second word of the second line.  The last vowel of the first line is the same as the last vowel of the second line. Note that there may be consonants after the vowel. 

Also, letters "a", "e", "o", "i", and "u" are vowels. Note that "y" is never vowel.

For example of a beautiful lyric,  "hello hellooowww" 

"whatsup yowowowow"  is a beautiful lyric because there are two vowels each in "hello" and "whatsup", four vowels each in "hellooowww" and "yowowowow" (keep in mind that "y" is not a vowel), and the last vowel of each line is "o".

For example of a not beautiful lyric,  "hey man"

"iam mcdic"  is not a beautiful lyric because "hey" and "iam" don't have same number of vowels and the last vowels of two lines are different ("a" in the first and "i" in the second).

How many beautiful lyrics can you write from given words? Note that you cannot use a word more times than it is given to you. For example, if a word is given three times, you can use it at most three times.


-----Input-----

The first line contains single integer $n$ ($1 \le n \le 10^{5}$) — the number of words.

The $i$-th of the next $n$ lines contains string $s_{i}$ consisting lowercase alphabet letters — the $i$-th word. It is guaranteed that the sum of the total word length is equal or less than $10^{6}$. Each word contains at least one vowel.


-----Output-----

In the first line, print $m$ — the number of maximum possible beautiful lyrics.

In next $2m$ lines, print $m$ beautiful lyrics (two lines per lyric).

If there are multiple answers, print any.


-----Examples-----
Input
14
wow
this
is
the
first
mcdics
codeforces
round
hooray
i
am
proud
about
that

Output
3
about proud
hooray round
wow first
this is
i that
mcdics am

Input
7
arsijo
suggested
the
idea
for
this
problem

Output
0

Input
4
same
same
same
differ

Output
1
same differ
same same



-----Note-----

In the first example, those beautiful lyrics are one of the possible answers. Let's look at the first lyric on the sample output of the first example. "about proud hooray round" forms a beautiful lyric because "about" and "hooray" have same number of vowels, "proud" and "round" have same number of vowels, and both lines have same last vowel. On the other hand, you cannot form any beautiful lyric with the word "codeforces".

In the second example, you cannot form any beautiful lyric from given words.

In the third example, you can use the word "same" up to three times.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
la=[]
le=[]
li=[]
lo=[]
lu=[]
ans=[]
d1={}
for i in range(n):
    s=input()
    x=s.count('a')+s.count('e')+s.count('i')+s.count('o')+s.count('u')
    if x>0:
        
        for c in s[::-1]:
            if c=='a' or c=='e' or c=='i' or c=='o' or c=='u':
                break
        if (x,c) in d1:
            d1[(x,c)].append(s)
        else :
            d1[(x,c)]=[s]
d2={}
pairs1=[]
pairs2=[]
for k in d1:
    if len(d1[k])%2==1:
        if k[0] in d2:
            d2[k[0]].append(d1[k][0])
        else :
            d2[k[0]]=[d1[k][0]]
        for i in range(1,len(d1[k]),2):
            pairs1.append((d1[k][i],d1[k][i+1]))
    else :
        for i in range(0,len(d1[k]),2):
            pairs1.append((d1[k][i],d1[k][i+1]))
for k in d2:
    if len(d2[k])>1:
        if len(d2[k])%2==1:
            d2[k].pop()
        for i in range(0,len(d2[k]),2):
            pairs2.append((d2[k][i],d2[k][i+1]))
if len(pairs1)<len(pairs2):
    print(len(pairs1))
    for i in range(len(pairs1)):
        print(pairs2[i][0],pairs1[i][0])
        print(pairs2[i][1],pairs1[i][1])
else :
    print(len(pairs2)+(len(pairs1)-len(pairs2))//2)
    for i in range(len(pairs2)):
        print(pairs2[i][0],pairs1[i][0])
        print(pairs2[i][1],pairs1[i][1])
    for j in range(len(pairs2),len(pairs1),2):
        if j==len(pairs1)-1:
            break
        else :
            print(pairs1[j][0],pairs1[j+1][0])
            print(pairs1[j][1],pairs1[j+1][1])
    


import sys
input = sys.stdin.readline

n=int(input())
W=[input().strip() for i in range(n)]
V={"a","i","u","e","o"}

K=[]

for i,w in enumerate(W):
    count=0
    VKEY=""

    for word in w:
        if word in V:
            count+=1
            VKEY=word

    K.append([count,VKEY,i])

K.sort()

from collections import deque
K2=deque(K)


Q=deque()
Q2=deque()

#print(K2)

while K2:
    if len(K2)>=2 and K2[0][0]==K2[1][0] and K2[0][1]==K2[1][1]:
        x=K2.popleft()
        y=K2.popleft()
        Q2.append(x)
        Q2.append(y)

    else:
        x=K2.popleft()
        Q.append(x)

Q1=deque()
while Q:
    if len(Q)>=2 and Q[0][0]==Q[1][0]:
        x=Q.popleft()
        y=Q.popleft()
        Q1.append(x)
        Q1.append(y)

    else:
        x=Q.popleft()

ANS=[]

#print(Q1)
#print(Q2)

while Q1 and Q2:
    x=Q1.popleft()
    y=Q2.popleft()
    z=Q1.popleft()
    w=Q2.popleft()
    ANS.append([x[2],y[2],z[2],w[2]])

while len(Q2)>=4:
    x=Q2.popleft()
    y=Q2.popleft()
    z=Q2.popleft()
    w=Q2.popleft()
    ANS.append([x[2],z[2],y[2],w[2]])

print(len(ANS))
for x,y,z,w in ANS:
    print(W[x],W[y])
    print(W[z],W[w])
    

    


from collections import defaultdict
import sys
input = lambda: sys.stdin.readline().strip()

def f(x):
  cnt = 0
  for i in x:
    if i in "aeiou":
      cnt += 1
  return cnt 

def last_vowel(s):
  for i in s[::-1]:
    if i in "aeiou":
      return i 

n = int(input())
sarr = [input() for i in range(n)]

d = defaultdict(list)


for s in sarr:
  d[(f(s), last_vowel(s))].append(s)

same_same = []
same_different = defaultdict(list)
for i, j in list(d.items()):
  if len(j) >= 2:
    if len(j) % 2 == 1:
      same_different[i[0]].append(j[-1])
      j.pop()
    for i in range(0, len(j), 2):
      same_same.append((j[i], j[i+1]))
  else:
    same_different[i[0]].append(j[0])

#print(same_same)

same_different_list = []
for i, j in list(same_different.items()):
  if len(j) >= 2:
    if len(j) % 2 == 1:
      j.pop()
    
    for i in range(0, len(j), 2):
      same_different_list.append((j[i], j[i+1]))

#print(same_different_list)


ans = []

while same_same and same_different_list:
  ans.append((same_same[-1], same_different_list[-1]))
  same_same.pop()
  same_different_list.pop()

while len(same_same) >= 2:
  ans.append((same_same[-1], same_same[-2]))
  same_same.pop()
  same_same.pop()

print(len(ans))

for (b1, b2), (a1, a2) in ans:
  sys.stdout.write(a1 + " " + b1 + "\n")
  sys.stdout.write(a2 + " " + b2 + "\n")



import sys
from collections import defaultdict
vowel = set([ord(x) for x in ('a', 'e', 'i', 'o', 'u')])
D = {v: i for i, v in enumerate([ord(x) for x in ('a', 'e', 'i', 'o', 'u')])}
N = int(input())
A = defaultdict(list)
B = defaultdict(list)
geta = 10
I = [sys.stdin.readline().strip() for _ in range(N)]
for i, S in enumerate(I):
    S = [ord(x) for x in S]
    p = None
    c = 0
    for s in S[::-1]:
        if s in vowel:
            if p is None:
                p = D[s]
            c += 1
    A[c*geta + p].append(i)
    B[c].append(i)

SA = sum(len(v)//2 for v in A.values())
SB = sum(len(v)//2 for v in B.values())
CA = []
CB = []
used = set()
for v in A.values():
    for i in range(0, len(v)-1, 2):
        CA.append((v[i], v[i+1]))
        used.add(v[i])
        used.add(v[i+1])
for v in B.values():
    fill = True
    T = None
    for i in v:
        if i not in used:
            fill = not fill
            if fill:
                CB.append((T, i))
            else:
                T = i

ans = min(SA, SB//2)
print(ans)
f = min(len(CA), len(CB))
for i in range(f):
    a, b = CA.pop()
    c, d = CB.pop()
    print(I[c], I[a])
    print(I[d], I[b])
for _ in range(ans - f):
    a, b = CA.pop()
    c, d = CA.pop()
    print(I[c], I[a])
    print(I[d], I[b])

voy=['a','e','i','o','u']
def de(a):
    for i in a[::-1]:
        if i in voy:
            return i
di={}
ta=set()
for k in range(int(input())):
    a=input()
    nb=sum((i in voy) for i in a)
    if not(nb in ta):
        for v in voy:
            di[(nb,v)]=[]
        ta.add(nb)
    d=de(a)
    cl=(nb,d)
    di[cl].append(a)
co1=sum(len(di[k])//2 for k in di)
co2=sum(sum(len(di[k,v]) for v in voy)//2 for k in ta)//2
wo=[]
co=min(co1,co2)
nb=0
for k in di:
    nbl=0
    for i,j in zip(di[k][::2],di[k][1::2]):
        if nb!=co:
            wo.append([i,j])
            nb+=1
            nbl+=1
    di[k]=di[k][2*nbl:]
di2=[di[k,'a']+di[k,'e']+di[k,'i']+di[k,'o']+di[k,'u'] for k in ta]
p=0
for k in di2:
    for i,j in zip(k[::2],k[1::2]):
        if p!=len(wo):
            wo[p].append(i)
            wo[p].append(j)
            p+=1
print(co)
for k in wo:
    print(k[2],k[0])
    print(k[3],k[1])


n = int(input())
word = []
endwith = [{} for i in range(5)]

second = []
first = {}

for i in range(n):
	w = input()
	word.append(w)
	c = 0
	lastkind = 0
	for ch in w:
		if ch == 'a':
			lastkind = 0
			c += 1
		elif ch == 'e':
			lastkind = 1
			c += 1
		elif ch == 'i':
			lastkind = 2
			c += 1
		elif ch == 'o':
			lastkind = 3
			c += 1
		elif ch == 'u':
			lastkind = 4
			c += 1
	if c not in endwith[lastkind]:
		endwith[lastkind][c] = [i]
	else:
		endwith[lastkind][c].append(i)
# print(endwith)
for i in range(5):
	for key, value in list(endwith[i].items()):
		while len(value) >= 2:
			second.append(value.pop())
			second.append(value.pop())
		if len(value) == 1:
			if key in first:
				first[key].append(value[0])
			else:
				first[key] = [value[0]]
ans = []
m = 0
for key, value in list(first.items()):
	while len(value) >= 2 and len(second) >= 2:
		ans.append((value.pop(), value.pop(), second.pop(), second.pop()))
		m += 1
while len(second) >= 4:
	ans.append((second.pop(), second.pop(), second.pop(), second.pop()))
	m += 1
print(m)
for tup in ans:
	print(word[tup[0]], word[tup[2]])
	print(word[tup[1]], word[tup[3]])





	




from collections import Counter
import sys


def count(word):
    lst = ''
    k = 0
    for el in word:
        if el in gl:
            k += 1
            lst = el
    return k, lst


n = int(input())
gl = set('aeoui')
d = dict()
b = dict()
for i in range(n):
    t = input()
    s = count(t)
    if s[0] in b:
        b[s[0]][t] += 1
    else:
        b[s[0]] = Counter()
        b[s[0]][t] += 1
    if s in d:
        d[s].append(t)
    else:
        d[s] = [t]
leftpair = []
rightpair = []
for el in d:
    for i in range(0, len(d[el]) - 1, 2):
        rightpair.append((d[el][i], d[el][i + 1]))
        b[el[0]][d[el][i]] -= 1
        b[el[0]][d[el][i + 1]] -= 1
# print(b)
for el in b:
    last1len = -1
    for ell in b[el]:
        if b[el][ell] % 2 == 1:
            if last1len != -1:
                leftpair[last1len].append(ell)
                last1len = -1
            else:
                leftpair.append([ell])
                last1len = len(leftpair) - 1
        for k in range(b[el][ell] // 2):
            leftpair.append((ell, ell))
    if last1len != -1:
        leftpair.pop(last1len)
if len(rightpair) > len(leftpair):
    t = (len(rightpair) + len(leftpair)) // 2
    leftpair.extend(rightpair[t:])
    rightpair = rightpair[:t]
print(min(len(leftpair), len(rightpair)))
# print(leftpair)
# print(rightpair)
for i in range(min(len(leftpair), len(rightpair))):
    sys.stdout.write(leftpair[i][0] + ' ' + rightpair[i][0] + '\n' + leftpair[i][1] + ' ' + rightpair[i][1] + '\n')


N = int(input())

words = [input() for _ in range(N)]
used = [0 for _ in range(N)]

def last_vowel(s):
	for i in range(len(s) - 1, -1, -1):
		if s[i] in "aeiou":
			return s[i]
	raise RuntimeException("CF BAD")

def count_vowels(s):
	count = 0
	for c in s:
		if c in "aeiou":
			count += 1
	return count

def key(s):
	count = 0
	last = ""
	for c in s:
		if c in "aeiou":
			count += 1
			last = c
	return (count, last)

buckets = {}
finalbuckets = {}

for index, word in enumerate(words):
	k = key(word)
	if k not in buckets: buckets[k] = []
	if k[0] not in finalbuckets: finalbuckets[k[0]] = []
	buckets[k].append(index)
	finalbuckets[k[0]].append(index)

fp = []
sp = []

for b in buckets:
	if len(buckets[b]) < 2: continue
	for i in range(0, len(buckets[b]) - 1, 2):
		sp.append((buckets[b][i], buckets[b][i + 1]))
		used[buckets[b][i]] = 1
		used[buckets[b][i + 1]] = 1

for b in finalbuckets:
	pair = None
	for word in finalbuckets[b]:
		if used[word]: continue
		if pair is None:
			pair = word
		else:
			fp.append((pair, word))
			pair = None

move = max(0, (len(sp) - len(fp)) // 2)

z = list(zip(fp + sp[:move], sp[move:]))

print(len(z))

for (f0, f1), (s0, s1) in z:
	print(words[f0], words[s0])
	print(words[f1], words[s1])


# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())
words = [input()[:-1] for _ in range(N)]
vowels = ("a", "i", "u", "e", "o")

counted_word = []
for word in words:
    last_vowel = ""
    num_vowel = 0
    for c in word:
        if c in vowels:
            num_vowel += 1
            last_vowel = c
    counted_word.append([word, num_vowel, last_vowel])

counted_word = sorted(counted_word, key=lambda x: (x[1], x[2]))

cand_second = []
unused = []
used = [False]*N

for i, w1, w2 in zip(list(range(N)), counted_word, counted_word[1:]):
    if used[i]:
        continue
    if w1[1] == w2[1] and w1[2] == w2[2]:
        cand_second.append([w1, w2])
        used[i] = True
        used[i+1] = True
    else:
        unused.append(w1)
if not used[-1]:
    unused.append(counted_word[-1])

cand_first = []
used = [0]*len(unused)
for i, w1, w2 in zip(list(range(len(unused))), unused, unused[1:]):
    if used[i]:
        continue
    if w1[1] == w2[1]:
        cand_first.append([w1, w2])
        used[i] = True
        used[i+1] = True

len_first = len(cand_first)
len_second = len(cand_second)

diff = len_second-len_first
if diff > 1:
    for i in range(diff//2):
        cand_first.append(cand_second[-i-1])
ans = min(len_second, len(cand_first))

print(ans)
for first, second in zip(cand_first, cand_second):
    print(first[0][0], second[0][0])
    print(first[1][0], second[1][0])


n = int( input() )
words = [ input() for i in range( n ) ]

d = {}
for w in words:
    vs = "".join( [ c if c in 'aeiou' else '' for c in w ])
    v = len(vs)
    last = vs[ -1 ]
    if not v in d:
        d[ v ] = {}
    dd = d[ v ]
    if not last in dd:
        dd[ last ] = []
    dd[ last ].append( w )

pairs = []
e = {}
for v, dd in list(d.items()):
    for c, l in list(dd.items()):
        while len(l) > 1:
            p = l.pop(), l.pop()
            pairs.append( p )
        if len( l ) > 0:
            if v in e:
                e[ v ] += l
            else:
                e[ v ] = l

ans = []
for c, l in list(e.items()):
    while len( l ) > 1 and len( pairs ) > 0:
        a = l.pop(), l.pop()
        for i, j in zip(a,pairs.pop()):
            ans.append( (i,j))

while len( pairs ) > 1:
    for i, j in zip( pairs.pop(), pairs.pop() ):
        ans.append( (i,j) )

print( len( ans ) // 2 )
for i, j in ans:
    print( i, j )


GL = set(list("aeiou"))

n = int(input())
di = dict()
tails = dict()
ends = 0
ends_words = []
starts = 0
starts_words = []

for i in range(n):
    word = input()
    counter = 0
    for w in word:
        if w in GL:
            last = w
            counter += 1
    if (last, counter) not in di:
        di[(last, counter)] = [word]
    else:
        di[(last, counter)].append(word)

for i in list(di.keys()):
    ends += len(di[i]) // 2 * 2
    while len(di[i]) > 1:
        fir = di[i].pop()
        sec = di[i].pop()
        ends_words.append([fir, sec])


for i in list(di.keys()):
    if di[i] == []:
        continue
    if i[1] in tails:
        starts += 2
        starts_words.append([di[i][0], tails[i[1]]])
        del tails[i[1]]
    else:
        tails[i[1]] = di[i][0]

while len(ends_words) > len(starts_words):
    starts_words.append(ends_words.pop())

print(len(ends_words))
for i in range(len(ends_words)):
    end = ends_words.pop()
    st = starts_words.pop()
    print(st[0], end[0])
    print(st[1], end[1])


    


from collections import deque

if True:
    N = int(input())
    # X = [[[] for _ in range(5)] for i in range(500001)]
    X = {}
    def calc(t):
        c = 0
        v = 0
        for u in reversed(t):
            if u == "a" or u == "i" or u == "u" or u == "e" or u == "o":
                if c == 0:
                    if u == "a": v = 0
                    if u == "i": v = 1
                    if u == "u": v = 2
                    if u == "e": v = 3
                    if u == "o": v = 4
                c += 1
        if c not in X:
            X[c] = [[] for _ in range(5)]
        
        X[c][v].append(t)

    for _ in range(N):
        calc(input())
else:
    N = 14
    X = [[[], [], [], [], []], [['am', 'that'], ['this', 'is', 'first', 'mcdics', 'i'], [], ['the'], ['wow']], [[], [], ['round', 'proud'], [], []], [['hooray'], [], ['about'], [], []], [[], [], [], ['codeforces'], []]]
# print("X =", X)
A = 0
B = 0
Q = deque([])
for i in X:
    # print("X[i] =", X[i])
    # print([len(x)//2 for x in X[i]])
    a = sum([len(x)//2 for x in X[i]]) * 2
    b = sum([len(x) for x in X[i]])//2*2 - a
    A += a
    B += b
    # print("a, b, A, B =", a, b, A, B)
    for j in range(5):
        while len(X[i][j]) >= 2:
            deque.appendleft(Q, X[i][j].pop())
            deque.appendleft(Q, X[i][j].pop())
    
    for j in range(5):
        while len(X[i][j]) >= 1 and b > 0:
            deque.append(Q, X[i][j].pop())
            b -= 1
    # print("Q =", Q)

ans = min(A//2, (A+B)//4)
print(ans)
for _ in range(ans):
    print(Q.pop(), Q.popleft())
    print(Q.pop(), Q.popleft())




VOWELS = ('a', 'e', 'i', 'o', 'u')

def main():
    buf = input()
    n = int(buf)
    s = []
    for i in range(n):
        buf = input()
        s.append(buf)
    word_info = []
    for i, x in enumerate(s):
        vowel_count = 0
        last_vowel = None
        for c in x:
            if c in VOWELS:
                vowel_count += 1
                last_vowel = c
        word_info.append((i, vowel_count, last_vowel))
    word_info.sort(key=lambda x: (x[1], x[2]))
    word_pair = []
    word_pair_first_only = []
    last_vowel_count = 0
    last_last_vowel = None
    last_word = None
    last_word_leftover = None
    for i, x in enumerate(word_info):
        if x[1] > last_vowel_count:
            if last_word and last_word_leftover:
                word_pair_first_only.append((last_word, last_word_leftover))
            last_word_leftover = None
            last_word = None
            last_vowel_count = x[1]
            last_last_vowel = x[2]
        if x[2] != last_last_vowel:
            if last_word:
                if last_word_leftover:
                    word_pair_first_only.append((last_word, last_word_leftover))
                    last_word_leftover = None
                else:
                    last_word_leftover = last_word
                last_word = None
            last_last_vowel = x[2]
        if last_word:
            word_pair.append((last_word, x))
            last_word = None
        else:
            last_word = x
    if last_word and last_word_leftover:
        word_pair_first_only.append((last_word, last_word_leftover))
    lyrics = []
    first_only_pointer = 0
    last_word_pair = None
    for i, x in enumerate(word_pair):
        if first_only_pointer < len(word_pair_first_only):
            last_word_pair = word_pair_first_only[first_only_pointer]
            first_only_pointer += 1
        if last_word_pair:
            lyrics.append((last_word_pair, x))
            last_word_pair = None
        else:
            last_word_pair = x
    print(len(lyrics))
    for x in lyrics:
        print(s[x[0][0][0]], s[x[1][0][0]])
        print(s[x[0][1][0]], s[x[1][1][0]])


def __starting_point():
    main()

__starting_point()

vowelList=['a','e','i','o','u']

r=int(input())
stringArr=[]
for i in range(r):
    string=input()
    properties=[]
    properties.append(string)
    backStr=string[::-1]
    numVowel=0
    for j in range(len(string)):
        if backStr[j] in vowelList:
            if numVowel==0:
                properties.append(backStr[j])
            numVowel+=1
    properties.append(numVowel)
    stringArr.append(properties)
stringArr.sort(key=lambda arr: arr[2])
n=1
left=0
equalNumVowels=[]
correspondingSecondPairs=[]
correspondingFirstPairs=[]
currentArr=[]
for i in range(r):
    if stringArr[i][2]>n:
        equalNumVowels.append(currentArr)
        n=stringArr[i][2]
        currentArr=[]
    currentArr.append(stringArr[i])
    
equalNumVowels.append(currentArr)


for ar in equalNumVowels:
    aArr=[]
    eArr=[]
    iArr=[]
    oArr=[]
    uArr=[]
    for item in ar:
        if item[1]=="a":
            aArr.append(item)
        elif item[1]=="e":
            eArr.append(item)
        elif item[1]=="i":
            iArr.append(item)
        elif item[1]=="o":
            oArr.append(item)
        else:
            uArr.append(item)
    while len(aArr)>1:
        m=aArr.pop()
        n=aArr.pop()
        correspondingSecondPairs.append([m,n])
    while len(eArr)>1:
        m=eArr.pop()
        n=eArr.pop()
        correspondingSecondPairs.append([m,n])
    while len(iArr)>1:
        m=iArr.pop()
        n=iArr.pop()
        correspondingSecondPairs.append([m,n])
    while len(oArr)>1:
        m=oArr.pop()
        n=oArr.pop()
        correspondingSecondPairs.append([m,n])
    while len(uArr)>1:
        m=uArr.pop()
        n=uArr.pop()
        correspondingSecondPairs.append([m,n])
    leftOver=[]
    if len(aArr)==1:
        leftOver.append(aArr[0])
    if len(eArr)==1:
        leftOver.append(eArr[0])
    if len(iArr)==1:
        leftOver.append(iArr[0])
    if len(oArr)==1:
        leftOver.append(oArr[0])
    if len(uArr)==1:
        leftOver.append(uArr[0])
    while len(leftOver)>1:
        m=leftOver.pop()
        n=leftOver.pop()
        correspondingFirstPairs.append([m,n])
    
print(min(len(correspondingSecondPairs),len(correspondingFirstPairs)+(len(correspondingSecondPairs)-len(correspondingFirstPairs))//2))
while len(correspondingFirstPairs)>=1 and len(correspondingSecondPairs)>=1:
    a=correspondingFirstPairs.pop()
    b=correspondingSecondPairs.pop()
    print(str(a[0][0]) + " " + str(b[0][0]) + "\n" + str(a[1][0]) + " " + str(b[1][0]))

while len(correspondingSecondPairs)>=2:
    a=correspondingSecondPairs.pop()
    b=correspondingSecondPairs.pop()
    print(str(a[0][0]) + " " + str(b[0][0]) + "\n" + str(a[1][0]) + " " + str(b[1][0]))

n = int(input())
d = {}
ish = {'a', 'e', 'o', 'i', 'u'}


def last_g(x):
    for el in x[::-1]:
        if el in ish:
            return el


for i in range(n):
    s = input()
    count = s.count('a') + s.count('e') + s.count('o') + s.count('i') + s.count('u')
    if count in d:
        d[count].append(s)
    else:
        d[count] = [s]
firsts = []
seconds = []
for e in d:
    gd = {'a': [], 'e': [], 'o': [], 'i': [], 'u': []}
    pairs = []
    for s in d[e]:
        gd[last_g(s)].append(s)
    for b in gd:
        for i in range(0, len(gd[b])-1, 2):
            seconds.append((gd[b][i], gd[b][i+1]))
        if len(gd[b])%2 == 1:
            pairs.append(gd[b][-1])
    for i in range(0, len(pairs)-1, 2):
        firsts.append((pairs[i], pairs[i+1]))
q = len(seconds)
m = len(firsts)
if m >= q:
    print(q)
    for i in range(q):
        print(firsts[i][0] + ' ' + seconds[i][0])
        print(firsts[i][1] + ' ' + seconds[i][1])
else:
    print(m + (q - m)//2)
    for i in range(m):
        print(firsts[i][0] + ' ' + seconds[i][0])
        print(firsts[i][1] + ' ' + seconds[i][1])
    for i in range(m, q-1, 2):
        print(seconds[i][0] + ' ' + seconds[i+1][0])
        print(seconds[i][1] + ' ' + seconds[i+1][1])

import os
from io import BytesIO, StringIO
#input = BytesIO(os.read(0, os.fstat(0).st_size)).readline

DEBUG = False
debug_print = print if DEBUG else lambda *x,**y: None

def input_as_list():
    return list(map(int, input().split()))

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

def main():
    from collections import defaultdict

    n = int(input())
    vowels = 'aeiou'

    def parse(s):
        count = 0
        last_vowel = ''

        for c in s:
            if c in vowels:
                count += 1
                last_vowel = c

        return count, last_vowel


    alls = []
    pool = defaultdict(dict)
    poolA = []
    poolB = []

    for _ in range(n):
        alls.append(input())

    for s in alls:
        c, lv = parse(s)

        if lv in pool[c]:
            s2 = pool[c].pop(lv)
            poolB.append((s, s2))
        else:
            pool[c][lv] = s

    for d in pool.values():
        d = [s for s in d.values()]
        while len(d) >= 2:
            poolA.append((d.pop(), d.pop()))

    debug_print(poolA, poolB, n)

    out = []
    while poolB:
        s2, s4 = poolB.pop()
        if poolA:
            s1, s3 = poolA.pop()
        else:
            if poolB:
                s1, s3 = poolB.pop()
            else:
                break
        out.append(s1 + ' ' + s2 + '\n' + s3 + ' ' + s4)

    print(len(out))
    print('\n'.join(out))

main()

def fun(string):
    last = ''
    amount = 0
    saw = False
    r = len(string)
    for i in range(r - 1, -1, -1):
        if string[i] in gay:
            amount += 1
            if not saw:
                saw = True
                last = string[i]
    return amount, last


def main():
    n = int(input())
    # to hack this solution write any test with n == 2e5, TLE
    words = {}
    sizesandlasts = {}
    sizes = set()
    for i in range(n):
        s = input()
        pair = size, last = fun(s)
        sizes.add(size)
        words[s] = pair
        if pair not in sizesandlasts:
            sizesandlasts[pair] = []
        sizesandlasts[pair].append(s)

    second = []
    first = {}
    for length in sizes:
        for ch in gay:
            text = sizesandlasts.get((length, ch), [])
            for val in range(len(text) // 2):
                second.append([text.pop(), text.pop()])
            if len(text) > 0:
                size = words[text[0]][0]
                if size not in first:
                    first[size] = []
                first[size].append(text.pop())

    ans = []
    for size in first:
        if len(second) == 0:
            break
        else:
            while len(first[size]) > 1 and len(second) > 0:
                ans.append([[first[size].pop(), first[size].pop()], second.pop()])
    while len(second) > 1:
        ans.append([second.pop(), second.pop()])
    print(len(ans))
    for i in range(len(ans)):
        print("{} {}".format(ans[i][0][0], ans[i][1][0]))
        print("{} {}".format(ans[i][0][1], ans[i][1][1]))


gay = set()
for char in ['a', 'e', 'o', 'i', 'u']:
    gay.add(char)
main()


n = int(input())

vowels = {'a', 'e', 'o', 'i', 'u'}

words = []
for i in range(n):
	words.append(input())


all_pairs = {}
sec_pairs = {}

for item in words:
	cnt, last = 0, -1
	for i in item:
		if i in vowels:
			cnt += 1
			last = i

	# all_pairs
	if cnt not in all_pairs:
		all_pairs[cnt] = {item : 1}
	else:
		if item in all_pairs[cnt]:
			all_pairs[cnt][item] += 1
		else:
			all_pairs[cnt][item] = 1

	# sec_pairs
	if cnt not in sec_pairs:
		sec_pairs[cnt] = {last: {item: 1} }
	else:
		if last not in sec_pairs[cnt]:
			sec_pairs[cnt][last] = {item : 1}
		else:
			if item not in sec_pairs[cnt][last]:
				sec_pairs[cnt][last][item] = 1
			else:
				sec_pairs[cnt][last][item] += 1

s_p = 0
s_list = []
for cnt in list(sec_pairs.keys()):
	for last in list(sec_pairs[cnt].keys()):
		s = 0
		cnt_l_list = []
		for word in list(sec_pairs[cnt][last].keys()):
			s += sec_pairs[cnt][last][word]
			cnt_l_list += sec_pairs[cnt][last][word] * [word]
		s_p += s // 2
		s_list.extend(cnt_l_list[:2 * (s // 2)])


all_p = 0
for cnt in list(all_pairs.keys()):
	s = 0
	for word in list(all_pairs[cnt].keys()):
		s += all_pairs[cnt][word]
	all_p += s // 2

ans = min(s_p, all_p // 2)
s_list = s_list[:2*ans]

# undate all_p
for item in s_list:
	cnt = 0
	for i in item:
		if i in vowels:
			cnt += 1
	all_pairs[cnt][item] -= 1

f_list = []
for cnt in list(all_pairs.keys()):
	cnt_l = []
	s = 0
	for word in list(all_pairs[cnt].keys()):
		cnt_l += all_pairs[cnt][word] * [word]
		s += all_pairs[cnt][word]
	f_list.extend(cnt_l[:2*(s//2)])
f_list = f_list[:2*ans]
# print(f_list)
print(ans)
# print(s_list)

for i in range(ans):
	print(f_list[2*i], s_list[2*i])
	print(f_list[2*i+1], s_list[2*i+1])
	




import math
import sys

#imgur.com/Pkt7iIf.png

#n, m = map(int, input().split())
#n = int(input())
#d = list(map(int, input().split()))

n = int(input())
dicn = [{} for i in range(10**6)]
maxv = set()

v = {'a', 'e', 'i', 'o', 'u'}
for i in range(n):
    t = input()
    c = 0
    lv = ''
    for l in t:
        if l in v: 
            c += 1
            lv = l

    if lv in dicn[c-1]:
        dicn[c-1][lv].append(t)
    else: dicn[c-1][lv] = [t]
    maxv.add(c)

maxv = sorted(list(maxv))

first = [[] for i in range(maxv[-1])]
second = []

for i in maxv:
    for j in dicn[i-1]:
        if len(dicn[i-1][j])%2 == 1:
            #t = dicn[i-1][j].pop()
            first[i-1].append(dicn[i-1][j].pop())
        if len(dicn[i-1][j]) > 0: second += dicn[i-1][j]

t = []
c = 0

#print(first)
#print(second)

for f in first:
    while len(f) >= 2 and len(second) >= 2:
        c += 1
        t.append(' '.join([f.pop(), second.pop()]))
        t.append(' '.join([f.pop(), second.pop()]))
       
while len(second) >= 4:
    c += 1
    q = []
    w = [] 
    q.append(second.pop())
    w.append(second.pop())
    q.append(second.pop())
    w.append(second.pop())
    t.append(' '.join(q))
    t.append(' '.join(w))

print(len(t)//2)
for i in t:
    print(i)







import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      list(map(int, input().split()))
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

n = inn()
vowels = ['a', 'e', 'i', 'o', 'u']
h = {}
for v in vowels:
    h[v] = {}
counts = defaultdict(int)
for i in range(n):
    s = input()
    cnt = 0
    lastvow = '.'
    for j in range(len(s)):
        if s[j] in vowels:
            cnt += 1
            lastvow = s[j]
    #ddprint("s {} cnt {} lastvow {}".format(s,cnt,lastvow))
    if cnt not in h[lastvow]:
        h[lastvow][cnt] = []
    h[lastvow][cnt].append(s)
    counts[cnt] += 1

npairs = 0
for cnt in counts:
    npairs += counts[cnt]//2

nvpairs = 0
for v in vowels:
    for cnt in h[v]:
        nvpairs += len(h[v][cnt])//2

nlyrics = min(npairs//2, nvpairs)
if nlyrics == 0:
    print(0)
    return

lyrics = [0] * nlyrics
lcnt = 0
for v in vowels:
        for cnt in h[v]:
            while len(h[v][cnt]) >= 2:
                w21 = h[v][cnt].pop()
                w22 = h[v][cnt].pop()
                lyrics[lcnt] = [w21,w22]
                lcnt += 1
                if lcnt == nlyrics:
                    break
            if lcnt == nlyrics:
                break
        if lcnt == nlyrics:
            break

#ddprint(lyrics)

words = {}
for v in vowels:
    for cnt in h[v]:
        if cnt not in words:
            words[cnt] = []
        words[cnt].extend(h[v][cnt])

lcnt = 0
for cnt in words:
    while len(words[cnt]) >= 2:
        w11 = words[cnt].pop()
        w12 = words[cnt].pop()
        lyrics[lcnt].extend([w11,w12])
        lcnt += 1
        if lcnt == nlyrics:
            break
    if lcnt == nlyrics:
        break

print(nlyrics)
for z in lyrics:
    print("{} {}".format(z[2], z[0]))
    print("{} {}".format(z[3], z[1]))


n = int(input())


d = []
for _ in range(n):
    s1 = input()
    s2 = ""
    for c in s1:
        if c in ('a', 'e', 'o', 'i',  'u'):
            s2 += c

    d.append((len(s2), s2[-1], s1))


d.sort(key=lambda x: (x[0], x[1]))

r = []

ost = []
p_a, p_b, p_c = 0, '', ''
for a, b, c in d:
    if a == p_a and b == p_b:
        r.append([p_c, c])
        p_a, p_b, p_c = 0, '', ''
        continue
    if p_a != 0:
        ost.append((p_a, p_b, p_c))
    p_a, p_b, p_c = a, b, c

if p_a != 0:
    ost.append((p_a, p_b, p_c))


#print(r)
#print(ost)

i = 0
p_a, p_c = 0, ''
for a, b, c in ost:
    if a == p_a and i < len(r):
        r[i].append(p_c)
        r[i].append(c)
        p_a = 0
        i+=1
        continue
    p_a, p_b, p_c = a, b, c

#print(r)
r_final = r[:i]

for j in range(i, len(r), 2):

    if j < len(r)-1:
        r[j].extend(r[j + 1])
        r_final.append(r[j])

print(len(r_final))
for g in r_final:
    print(" ".join([g[2], g[0]]))
    print(" ".join([g[3], g[1]]))




first_pairs = []
second_pairs = []

lines = int(input())
words = {}
for i in range(lines):
    w = input()
    vow_cnt = 0
    vow_last = ''
    for c in w:
        if c in ['a', 'e', 'i', 'o', 'u']:
            vow_cnt += 1
            vow_last = c
    if vow_cnt not in words:
        words[vow_cnt] = {}
    if vow_last not in words[vow_cnt]:
        words[vow_cnt][vow_last] = w
    else:
        second_pairs.append((words[vow_cnt][vow_last], w))
        del words[vow_cnt][vow_last]

for l in words:
    first = None
    second = None
    for k in list(words[l].keys()):
        if first is None:
            first = k
            continue
        second = k
        first_pairs.append((words[l][first], words[l][second]))
        first = None

while len(first_pairs) < len(second_pairs):
    first_pairs.append(second_pairs.pop())

print(len(second_pairs))

for f, s in zip(first_pairs, second_pairs):
    print("{} {}".format(f[0], s[0]))
    print("{} {}".format(f[1], s[1]))


from collections import defaultdict

vow = "aeoiu"


def vowels(word):
    c = 0
    for i in word:
        if i in vow:
            c += 1
    return c


def last_vov(word):
    for i in reversed(word):
        if i in vow:
            return i


mp = defaultdict(lambda: defaultdict(list))

for _ in range(int(input())):
    w = input()
    mp[vowels(w)][last_vov(w)].append(w)

second_w = []
first_w = []

for last_v_dict in mp.values():
    first_w_t = []
    for words in last_v_dict.values():
        if len(words) % 2 == 1:
            if len(words) > 2:
                second_w += words[:-1]
            first_w_t.append(words[-1])
        else:
            second_w += words
    if len(first_w_t) >= 2:
        if len(first_w_t) % 2 == 1:
            first_w += first_w_t[:-1]
        else:
            first_w += first_w_t

while len(second_w) > len(first_w):
    first_w.append(second_w.pop())
    first_w.append(second_w.pop())

print(len(second_w) // 2)
for i, word in enumerate(second_w):
    print(first_w[i], word)