#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const int xx[4] = {1, -1, 0, 0};
const int yy[4] = {0, 0, 1, -1};
int inline nextin() {
  int t;
  if (scanf("%d", &t) != 1) exit(0);
  return t;
}
int inline in() {
  int x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
int n, k;
string s[10005];
map<int, int> m;
int rhyme(int pos) {
  string a = s[pos].substr(m[pos], ((int)(s[pos]).size()) - m[pos]);
  string b =
      s[pos + 1].substr(m[pos + 1], ((int)(s[pos + 1]).size()) - m[pos + 1]);
  string c =
      s[pos + 2].substr(m[pos + 2], ((int)(s[pos + 2]).size()) - m[pos + 2]);
  string d =
      s[pos + 3].substr(m[pos + 3], ((int)(s[pos + 3]).size()) - m[pos + 3]);
  if (a == b && b == c && c == d) return 0;
  if (a == b && c == d) return 1;
  if (a == c && b == d) return 2;
  if (a == d && b == c) return 3;
  return -1;
}
const string ans[4] = {"aaaa", "aabb", "abab", "abba"};
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < (4 * n); i++) cin >> s[i];
  for (int i = 0; i < (4 * n); i++) {
    int cnt = 0;
    bool ok = false;
    for (int j = ((int)(s[i]).size()) - 1; j >= 0; j--) {
      if (s[i][j] == 'a' || s[i][j] == 'e' || s[i][j] == 'i' ||
          s[i][j] == 'o' || s[i][j] == 'u')
        cnt++;
      if (cnt == k) {
        m[i] = j;
        ok = true;
        break;
      }
    }
    if (!ok) {
      puts("NO");
      return 0;
    }
  }
  set<int> Set;
  for (int i = 0; i < (n); i++) {
    Set.insert(rhyme(i * 4));
  }
  set<int>::iterator it = Set.begin();
  if (*it == -1)
    puts("NO");
  else if (((int)(Set).size()) >= 3)
    puts("NO");
  else if (((int)(Set).size()) == 2) {
    if (*it == 0) {
      it++;
      cout << ans[*it] << endl;
    } else
      puts("NO");
  } else
    cout << ans[*it] << endl;
  return 0;
}
