#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
template <typename T>
T sqr(const T &x) {
  return x * x;
}
template <typename T>
string GetString(const T &val) {
  ostringstream sout;
  sout << val;
  return sout.str();
}
int n, k;
const int SZ = 4;
bool IsV(char c) {
  const int SZ = 5;
  const char S[] = "aeiou";
  return find(S, S + SZ, c) != S + SZ;
}
string GetSuff(const string &s) {
  if (count_if((s).begin(), (s).end(), IsV) < k)
    return string() + (char)rand() + (char)rand() + (char)rand() + (char)rand();
  string res;
  int cnt = 0;
  for (int i = (s.size()) - 1; i >= 0; --i) {
    if (cnt == k) break;
    res += s[i];
    cnt += IsV(s[i]);
  }
  reverse((res).begin(), (res).end());
  return res;
}
int main() {
  set<string> cnt;
  cin >> n >> k;
  for (int i = 0; i < (n); ++i) {
    string s[SZ];
    for (int j = 0; j < (SZ); ++j) {
      cin >> s[j];
      s[j] = GetSuff(s[j]);
    }
    if (s[0] == s[1] && s[0] == s[2] && s[0] == s[3])
      cnt.insert("aaaa");
    else if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2])
      cnt.insert("aabb");
    else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1])
      cnt.insert("abab");
    else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1])
      cnt.insert("abba");
    else
      cnt.insert("###"), cnt.insert("####");
  }
  if (cnt.size() == 1) {
    cout << *cnt.begin() << endl;
  } else if (cnt.size() == 2 && *cnt.begin() == "aaaa") {
    cout << *(++cnt.begin()) << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
