#include <bits/stdc++.h>
using namespace std;
const double PI = 4 * atan(1.0);
void fast_stream() { std::ios_base::sync_with_stdio(0); }
int K;
bool isVowel(char a) {
  return a == 'a' || a == 'i' || a == 'u' || a == 'e' || a == 'o';
}
bool match(string &a, string &b) {
  int cnt = 0;
  for (int i = 0;; i++) {
    if (a[a.size() - i - 1] == b[b.size() - i - 1]) {
      if (isVowel(a[a.size() - i - 1])) cnt++;
    } else
      return false;
    if (cnt == K) return true;
    if (a.size() - i - 2 < 0 || b.size() - i - 2 < 0) return false;
  }
  return false;
}
int a[10001];
void solve() {
  int n;
  cin >> n >> K;
  string s;
  vector<int> kinds;
  for (int i = 0; i < n; i++) {
    vector<string> vs;
    for (int j = 0; j < 4; j++) {
      cin >> s;
      vs.push_back(s);
    }
    bool ok = true;
    for (int j = 1; j < 4; j++) {
      if (!match(vs[0], vs[j])) ok = false;
    }
    if (ok)
      kinds.push_back(3);
    else {
      ok = match(vs[0], vs[2]) && match(vs[1], vs[3]);
      if (ok)
        kinds.push_back(1);
      else {
        ok = match(vs[0], vs[1]) && match(vs[2], vs[3]);
        if (ok)
          kinds.push_back(0);
        else {
          ok = match(vs[0], vs[3]) && match(vs[2], vs[1]);
          if (ok)
            kinds.push_back(2);
          else
            kinds.push_back(4);
        }
      }
    }
  }
  for (int i = 0; i < (int)kinds.size(); i++) {
    if (kinds[i] == 4) {
      cout << "NO" << endl;
      return;
    }
  }
  for (int i = 0; i < (int)kinds.size(); i++) {
    a[kinds[i]]++;
  }
  if (a[0] > 0 && a[1] == 0 && a[2] == 0)
    cout << "aabb" << endl;
  else if (a[1] > 0 && a[0] == 0 && a[2] == 0)
    cout << "abab" << endl;
  else if (a[2] > 0 && a[1] == 0 && a[0] == 0)
    cout << "abba" << endl;
  else if (a[3] > 0 && a[0] == 0 && a[1] == 0 && a[2] == 0)
    cout << "aaaa" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  solve();
  return 0;
}
