#include <bits/stdc++.h>
using namespace std;
long i, j, n, k, xl, yl, res, z, gg, Min = 2000000000, len;
vector<long> a;
vector<string> s;
string buf, suf, s1, s2, s3, s4;
vector<bool> f(300, false);
set<string> ans;
set<string>::iterator be;
string findsuf(string s) {
  long z, kk;
  kk = k;
  for (z = s.length() - 1; z >= 0; z--) {
    if (f[s[z]]) {
      kk--;
      if (kk == 0) break;
    }
  }
  if (kk > 0) return (" ");
  return s.substr(z, s.length() - z);
}
int main() {
  ans.clear();
  f['a'] = true;
  f['e'] = true;
  f['o'] = true;
  f['i'] = true;
  f['u'] = true;
  scanf("%ld %ld\n", &n, &k);
  for (i = 0; i < n; i++) {
    s.resize(0);
    len = -1;
    suf.clear();
    for (j = 0; j < 4; j++) {
      cin >> buf;
      s.push_back(buf);
      if (j == 0) {
        suf = findsuf(buf);
        len = suf.length();
      }
    }
    s1 = suf;
    if (suf == " ") {
      cout << "NO";
      return 0;
    }
    s2 = findsuf(s[1]);
    s3 = findsuf(s[2]);
    s4 = findsuf(s[3]);
    if (s2 == " " || s3 == " " || s4 == " ") {
      cout << "NO";
      return 0;
    }
    if (s1 == s2 && s2 == s3 && s3 == s4)
      ans.insert("aaaa");
    else if (s1 == s2 && s3 == s4)
      ans.insert("aabb");
    else if (s1 == s4 && s2 == s3)
      ans.insert("abba");
    else if (s1 == s3 && s2 == s4)
      ans.insert("abab");
    else {
      cout << "NO";
      return 0;
    }
  }
  if (ans.size() == 2 && *(ans.begin()) == "aaaa") {
    be = ans.begin();
    be++;
    cout << *be;
  } else if (ans.size() > 1)
    cout << "NO";
  else
    cout << *(ans.begin());
  return 0;
}
