#include <bits/stdc++.h>
using namespace std;
int i, j, n, k, res;
vector<string> Stih[3000];
vector<string> Sol[3000];
int vow(char a) {
  return (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u');
}
string suff(string prv) {
  int cnt = 0, startfrom = -1;
  for (j = prv.size() - 1; j >= 0; j--) {
    if (vow(prv[j])) cnt++;
    if (cnt == k) {
      startfrom = j;
      break;
    }
  }
  string ret = "";
  if (startfrom != -1) {
    for (int kk = j; kk < prv.size(); kk++) {
      ret += prv[kk];
    }
  }
  return ret;
}
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 4; j++) {
      string t;
      cin >> t;
      Stih[i].push_back(t);
    }
  }
  for (i = 0; i < n; i++) {
    string prv = Stih[i][0], sec = Stih[i][1], trd = Stih[i][2],
           frt = Stih[i][3];
    string suff1 = suff(prv);
    string suff2 = suff(sec);
    string suff3 = suff(trd);
    string suff4 = suff(frt);
    string type = "";
    if (suff1.size() && suff2.size() && suff1 == suff2) {
      if (suff3.size() && suff4.size() && suff3 == suff4) {
        type = "aabb";
        Sol[i].push_back(type);
      }
    }
    if (suff1.size() && suff3.size() && suff1 == suff3) {
      if (suff2.size() && suff4.size() && suff2 == suff4) {
        type = "abab";
        Sol[i].push_back(type);
      }
    }
    if (suff1.size() && suff4.size() && suff1 == suff4) {
      if (suff2.size() && suff3.size() && suff2 == suff3) {
        type = "abba";
        Sol[i].push_back(type);
      }
    }
    if (suff1.size() && suff2.size() && suff3.size() && suff4.size() &&
        suff1 == suff3 && suff1 == suff2 && suff1 == suff4) {
      type = "aaaa";
      Sol[i].push_back(type);
    }
  }
  string ok[] = {"aaaa", "aabb", "abab", "abba"};
  for (i = 0; i < 4; i++) {
    int cnt = 0;
    for (j = 0; j < n; j++) {
      bool found = false;
      for (int s = 0; s < Sol[j].size(); s++) {
        if (ok[i] == Sol[j][s]) found = true;
      }
      if (!found) break;
      cnt++;
      if (cnt == n) {
        cout << ok[i] << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
