#include <bits/stdc++.h>
using namespace std;
int style[2500];
int n, k;
string lk[4];
string getLaskK(const string& str) {
  if (str.size() < k) return "";
  int l = str.size() - 1;
  int tot = 0;
  while (l >= 0) {
    if (str[l] == 'a' || str[l] == 'e' || str[l] == 'i' || str[l] == 'o' ||
        str[l] == 'u') {
      tot++;
      if (tot == k) break;
    }
    l--;
  }
  if (tot == k)
    return str.substr(l);
  else
    return "";
}
inline bool isRhy(int ind1, int ind2) {
  if (lk[ind1].size() == 0 || lk[ind2].size() == 0) return false;
  return lk[ind1] == lk[ind2];
}
int main() {
  bool a[4][4];
  string strr;
  getline(cin, strr);
  stringstream ss;
  ss << strr;
  ss >> n >> k;
  bool ok = true;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) {
      string str;
      getline(cin, str);
      lk[j] = getLaskK(str);
      if (lk[j].size() == 0) {
        ok = false;
        break;
      }
    }
    if (!ok) break;
    a[0][1] = isRhy(0, 1);
    a[2][3] = isRhy(2, 3);
    a[0][2] = isRhy(0, 2);
    a[1][3] = isRhy(1, 3);
    a[0][3] = isRhy(0, 3);
    a[1][2] = isRhy(1, 2);
    if (a[0][1] && a[1][2] && a[2][3]) {
      style[i] = 4;
    } else if (a[0][1] && a[2][3]) {
      style[i] = 1;
    } else if (a[0][2] && a[1][3]) {
      style[i] = 2;
    } else if (a[0][3] && a[1][2]) {
      style[i] = 3;
    } else {
      ok = false;
      break;
    }
  }
  if (!ok) {
    cout << "NO" << endl;
    return 0;
  }
  int curStyle = style[0];
  for (int i = 1; i < n; i++) {
    if (curStyle == style[i]) continue;
    if (style[i] == 4) continue;
    if (curStyle == 4) {
      curStyle = style[i];
      continue;
    }
    cout << "NO" << endl;
    return 0;
  }
  if (curStyle == 1) {
    cout << "aabb" << endl;
  } else if (curStyle == 2) {
    cout << "abab" << endl;
  } else if (curStyle == 3) {
    cout << "abba" << endl;
  } else if (curStyle == 4) {
    cout << "aaaa" << endl;
  }
  return 0;
}
