#include <bits/stdc++.h>
using namespace std;
const int maxn = 10010;
string s1[maxn];
string check(string t1, string t2, string t3, string t4) {
  if (t1 == t2 && t3 == t4 && t1 == t3) return "aaaa";
  if (t1 == t3 && t2 == t4 && t1 != t2) return "abab";
  if (t1 == t4 && t2 == t3 && t1 != t2) return "abba";
  if (t1 == t2 && t3 == t4 && t1 != t3) return "aabb";
  return "err";
}
int main() {
  int n, l;
  cin >> n >> l;
  for (int i = 0; i < n * 4; i++) cin >> s1[i];
  bool aaaa = false, aabb = false, abab = false, abba = false;
  for (int i = 0; i < n; i++) {
    string t1, t2, t3, t4;
    for (int j = 0; j < 4; j++) {
      int cnt = 0;
      for (int k = s1[4 * i + j].size() - 1; k >= 0; k--) {
        cnt += (s1[4 * i + j][k] == 'a' || s1[4 * i + j][k] == 'e' ||
                s1[4 * i + j][k] == 'i' || s1[4 * i + j][k] == 'o' ||
                s1[4 * i + j][k] == 'u');
        if (cnt == l) {
          if (j == 0) t1 = s1[4 * i + j].substr(k, s1[4 * i + j].size() - k);
          if (j == 1) t2 = s1[4 * i + j].substr(k, s1[4 * i + j].size() - k);
          if (j == 2) t3 = s1[4 * i + j].substr(k, s1[4 * i + j].size() - k);
          if (j == 3) t4 = s1[4 * i + j].substr(k, s1[4 * i + j].size() - k);
          break;
        }
      }
      if (cnt < l) {
        cout << "NO" << endl;
        return 0;
      }
    }
    string tmp = check(t1, t2, t3, t4);
    if (tmp == "aaaa") aaaa = true;
    if (tmp == "aabb") aabb = true;
    if (tmp == "abab") abab = true;
    if (tmp == "abba") abba = true;
    if (tmp == "err") {
      cout << "NO" << endl;
      return 0;
    }
  }
  if ("aaaa") {
    if (!aabb && !abab && !abba)
      cout << "aaaa" << endl;
    else if (aabb && !abab && !abba)
      cout << "aabb" << endl;
    else if (!aabb && abab && !abba)
      cout << "abab" << endl;
    else if (!aabb && !abab && abba)
      cout << "abba" << endl;
    else
      cout << "NO" << endl;
    return 0;
  } else {
    if (aabb && !abab && !abba)
      cout << "aabb" << endl;
    else if (!aabb && abab && !abba)
      cout << "abab" << endl;
    else if (!aabb && !abab && abba)
      cout << "abba" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
