#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const long double pi = acos(-1.0);
bool is_vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
string get_str(const string &s, int k) {
  string t;
  for (int i = s.length() - 1; i >= 0; --i) {
    t += s[i];
    if (is_vowel(s[i])) {
      k--;
      if (k == 0) return t;
    }
  }
  return "";
}
bool is_rythm(const string &s, const string &t, int k) {
  string sw = get_str(s, k);
  string tw = get_str(t, k);
  if (sw == "" || tw == "") return false;
  return sw == tw;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<string> a(4 * n);
  string s;
  getline(cin, s);
  for (int i = 0; i < a.size(); ++i) getline(cin, a[i]);
  set<string> types;
  types.insert("aabb");
  types.insert("abab");
  types.insert("abba");
  for (int i = 0; i < n; ++i) {
    set<string> cur;
    string p = a[4 * i + 0];
    string q = a[4 * i + 1];
    string r = a[4 * i + 2];
    string s = a[4 * i + 3];
    if (is_rythm(p, q, k) && is_rythm(r, s, k)) cur.insert("aabb");
    if (is_rythm(p, r, k) && is_rythm(q, s, k)) cur.insert("abab");
    if (is_rythm(p, s, k) && is_rythm(q, r, k)) cur.insert("abba");
    set<string> out;
    for (set<string>::iterator it = types.begin(); it != types.end(); ++it)
      if (cur.count(*it)) out.insert(*it);
    types = out;
  }
  if (types.size() == 3)
    cout << "aaaa" << endl;
  else if (types.size() == 0)
    cout << "NO" << endl;
  else if (types.size() == 1)
    cout << *types.begin() << endl;
  else
    assert(false);
  return 0;
}
