#include <iostream>
#include <algorithm>
using namespace std;
#define MAXN 15
int L, C;
char words[MAXN];
void dfs(int now, int cnt, int vols, int cons, string str) {
if (cnt == L) {
if (vols >=1 && cons >= 2) cout << str << "\n";
return;
}
for (int i = now; i < C; i++) {
if (words[i] == 'a' || words[i] == 'e'
|| words[i] == 'i' || words[i] == 'o'
|| words[i] == 'u') {
dfs(i + 1, cnt + 1, vols + 1, cons, str + words[i]);
}
else dfs(i + 1, cnt + 1,vols,cons+1, str + words[i]);
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> L >> C;
for (int i = 0; i < C; i++) {
cin >> words[i];
}
sort(words, words + C);
dfs(0, 0, 0, 0,"");
return 0;
}