#include <bits/stdc++.h>
using namespace std;
const string VOWELS = "aeuoi";
int n, k;
string rhymeSuffix(string s) {
  int u = 0;
  for (int i = s.size(); i >= 0; i--) {
    if (VOWELS.find(s[i]) != VOWELS.npos) u++;
    if (u == k) return s.substr(i);
  }
  return "";
}
int main() {
  cin >> n >> k;
  vector<int> can(n);
  for (int i = 0; i < n; i++) {
    vector<string> q(4);
    for (int j = 0; j < 4; j++) {
      cin >> q[j];
      q[j] = rhymeSuffix(q[j]);
      if (q[j] == "") {
        cout << "NO\n";
        return 0;
      }
    }
    can[i] |= (!!(q[0] == q[1] && q[2] == q[3]));
    can[i] |= (!!(q[0] == q[2] && q[1] == q[3])) << 1;
    can[i] |= (!!(q[0] == q[3] && q[1] == q[2])) << 2;
    can[i] |= (!!(q[0] == q[1] && q[1] == q[2] && q[2] == q[3])) << 3;
  }
  int res = 15;
  for (int i = 0; i < n; i++) res &= can[i];
  if ((res >> 3) & 1) {
    cout << "aaaa\n";
    return 0;
  }
  if ((res >> 2) & 1) {
    cout << "abba\n";
    return 0;
  }
  if ((res >> 1) & 1) {
    cout << "abab\n";
    return 0;
  }
  if ((res >> 0) & 1) {
    cout << "aabb\n";
    return 0;
  }
  cout << "NO\n";
  return 0;
}
