#include <bits/stdc++.h>
using namespace std;
const long long mod = (int)1e9 + 7;
int n, k;
vector<string> v(4);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.setf(ios::fixed), cout.precision(20);
  cin >> n >> k;
  bool yes = true;
  set<string> sh;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> v[j];
    }
    if (!yes) continue;
    vector<string> aa(4);
    bool xx = true;
    for (int var = 0; var < 4; var++) {
      long long cnt = 0;
      long long pos;
      for (int j = v[var].size() - 1; j >= 0; j--) {
        if (v[var][j] == 'a' || v[var][j] == 'e' || v[var][j] == 'i' ||
            v[var][j] == 'o' || v[var][j] == 'u') {
          cnt++;
          pos = j;
        }
        if (cnt == k) break;
      }
      if (cnt < k) {
        xx = false;
        break;
      } else {
        aa[var] = v[var].substr(pos);
      }
    }
    if (!xx) {
      yes = false;
      continue;
    }
    if (aa[0] == aa[1] && aa[2] == aa[3] && aa[0] == aa[2]) {
      sh.insert("aaaa");
    } else if (aa[0] == aa[1] && aa[2] == aa[3] && aa[0] != aa[2]) {
      sh.insert("aabb");
    } else if (aa[0] == aa[2] && aa[1] == aa[3] && aa[0] != aa[1]) {
      sh.insert("abab");
    } else if (aa[0] == aa[3] && aa[1] == aa[2] && aa[0] != aa[1]) {
      sh.insert("abba");
    } else {
      yes = false;
    }
  }
  if (!yes)
    cout << "NO"
         << "\n";
  else {
    if (sh.size() > 2)
      cout << "NO"
           << "\n";
    else if (sh.size() == 2) {
      if (sh.count("aaaa") == 1) {
        sh.erase("aaaa");
        cout << *sh.begin() << "\n";
      } else
        cout << "NO"
             << "\n";
    } else {
      cout << *sh.begin() << "\n";
    }
  }
  return 0;
}
