#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
#define FAST_IO() \
{\
ios::sync_with_stdio(false);\
cin.tie(NULL); \
cout.tie(NULL); \
}\
vector<char> v;
int l, c;
void DFS(int now, string str = "", int consonant = 0, int vowel = 0)
{
char ch = v[now];
str.push_back(ch);
if (ch == 'a' ||
ch == 'e' ||
ch == 'i' ||
ch == 'o' ||
ch == 'u')
vowel++;
else
consonant++;
if (str.length() == l)
{
if (vowel >= 1 &&
consonant >= 2)
cout << str << '\n';
return;
}
for (int i = now + 1; i < c; i++)
DFS(i, str, consonant, vowel);
}
int main()
{
FAST_IO();
cin >> l >> c;
v.resize(c);
for (int i = 0; i < c; i++)
cin >> v[i];
sort(v.begin(), v.end());
for (int i = 0; i <= c - l; i++)
DFS(i);
return 0;
}