import java.util.*;
import java.io.*;
public class Main {
static char[] input;
static StringBuilder sb = new StringBuilder();
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int L = Integer.parseInt(st.nextToken());
int C = Integer.parseInt(st.nextToken());
char[] alp = new char[C];
String str = br.readLine().replace(" ", "");
for (int i = 0; i < C; i++) {
alp[i] = str.charAt(i);
}
Arrays.sort(alp);
input = new char[L];
comb(L, alp, 0, 0, 0, 0);
System.out.println(sb);
br.close();
}
static void comb(int n, char[] ch, int cnt, int start, int cc, int cv) {
if (cnt == n) {
if (cc >= 2 && cv >= 1) {
sb.append(String.valueOf(input)).append("\n");
}
return;
}
for (int i = start; i < ch.length; i++) {
input[cnt] = ch[i];
if ("aeiou".contains(ch[i] + "")) {
comb(n, ch, cnt + 1, i + 1, cc, cv + 1);
} else {
comb(n, ch, cnt + 1, i + 1, cc + 1, cv);
}
}
}
}