#include <bits/stdc++.h>
using namespace std;
const signed long long Infinity = 1000000001;
const long double Pi = 2.0L * asinl(1.0L);
const long double Epsilon = 0.000000001;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  return os << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& V) {
  for (typeof(V.begin()) i = V.begin(); i != V.end(); ++i) os << *i << endl;
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& S) {
  for (typeof(S.begin()) i = S.begin(); i != S.end(); ++i) os << *i << endl;
  return os;
}
template <class T, class U>
ostream& operator<<(ostream& os, const map<T, U>& M) {
  for (typeof(M.begin()) i = M.begin(); i != M.end(); ++i) os << *i << endl;
  return os;
}
string vowel = "ouiea";
vector<string> A;
int n, k;
bool rhyme(string a, string b) {
  int i = a.size(), j = b.size();
  int t = k;
  while (i > 0 and t > 0) {
    i--;
    if (find(vowel.begin(), vowel.end(), a[i]) != vowel.end()) t--;
  }
  if (i == 0 and t != 0) return false;
  t = k;
  while (j > 0 and t > 0) {
    j--;
    if (find(vowel.begin(), vowel.end(), b[j]) != vowel.end()) t--;
  }
  if (j == 0 and t != 0) return false;
  return a.substr(i) == b.substr(j);
}
void readData() {
  scanf("%d %d", &n, &k);
  for (int(i) = (1); (i) <= (4 * n); (i)++) {
    string s;
    cin >> s;
    A.push_back(s);
  }
}
bool aaaa(int a) {
  if (!rhyme(A[4 * a], A[4 * a + 1])) return false;
  if (!rhyme(A[4 * a], A[4 * a + 2])) return false;
  if (!rhyme(A[4 * a], A[4 * a + 3])) return false;
  return true;
}
bool abba(int a) {
  if (!rhyme(A[4 * a], A[4 * a + 3])) return false;
  if (!rhyme(A[4 * a + 1], A[4 * a + 2])) return false;
  return true;
}
bool abab(int a) {
  if (!rhyme(A[4 * a], A[4 * a + 2])) return false;
  if (!rhyme(A[4 * a + 1], A[4 * a + 3])) return false;
  return true;
}
bool aabb(int a) {
  if (!rhyme(A[4 * a], A[4 * a + 1])) return false;
  if (!rhyme(A[4 * a + 2], A[4 * a + 3])) return false;
  return true;
}
bool AAAA() {
  for (int(i) = (0); (i) < (n); (i)++)
    if (!aaaa(i)) return false;
  return true;
}
bool AABB() {
  for (int(i) = (0); (i) < (n); (i)++)
    if (!aabb(i)) return false;
  return true;
}
bool ABAB() {
  for (int(i) = (0); (i) < (n); (i)++)
    if (!abab(i)) return false;
  return true;
}
bool ABBA() {
  for (int(i) = (0); (i) < (n); (i)++)
    if (!abba(i)) return false;
  return true;
}
void solve() {
  if (AAAA())
    printf("aaaa");
  else if (AABB())
    printf("aabb");
  else if (ABAB())
    printf("abab");
  else if (ABBA())
    printf("abba");
  else
    printf("NO");
}
int main() {
  readData();
  solve();
  return 0;
}
