#include <bits/stdc++.h>
using namespace std;
long long n;
long long m;
long long t;
long long k;
string line[100006];
long long quad[2502][4];
void solve() {}
void check(int i) {
  string s1, s2, s3, s4;
  s1 = line[i];
  s2 = line[i + 1];
  s3 = line[i + 2];
  s4 = line[i + 3];
  if (s1.compare(s2) == 0 && s3.compare(s4) == 0) quad[i / 4][0] = 1;
  if (s1.compare(s3) == 0 && s2.compare(s4) == 0) quad[i / 4][1] = 1;
  if (s1.compare(s4) == 0 && s2.compare(s3) == 0) quad[i / 4][2] = 1;
  quad[i / 4][3] = quad[i / 4][0] * quad[i / 4][1] * quad[i / 4][2];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  n *= 4;
  cin >> k;
  for (int i = 0; i < n; i++) {
    string s, ns;
    cin >> s;
    int w = 0;
    int p = s.length() - 1;
    while (p >= 0 && w < k) {
      if (s[p] == 'a' || s[p] == 'e' || s[p] == 'i' || s[p] == 'o' ||
          s[p] == 'u') {
        w++;
      }
      p--;
    }
    if (w < k) {
      cout << "NO" << endl;
      return 0;
    } else {
      ns = s.substr(p + 1);
    }
    line[i] = ns;
  }
  for (int i = 0; i < n; i += 4) {
    check(i);
  }
  bool aaaa = true;
  for (int i = 0; i < n; i += 4) {
    if (quad[i / 4][3] == 0) aaaa = false;
  }
  if (aaaa) {
    cout << "aaaa" << endl;
    return 0;
  }
  bool aabb = true;
  for (int i = 0; i < n; i += 4) {
    if (quad[i / 4][0] == 0) aabb = false;
  }
  if (aabb) {
    cout << "aabb" << endl;
    return 0;
  }
  bool abab = true;
  for (int i = 0; i < n; i += 4) {
    if (quad[i / 4][1] == 0) abab = false;
  }
  if (abab) {
    cout << "abab" << endl;
    return 0;
  }
  bool abba = true;
  for (int i = 0; i < n; i += 4) {
    if (quad[i / 4][2] == 0) abba = false;
  }
  if (abba) {
    cout << "abba" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
