#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;
}
string s[10005];
inline void nope() {
  puts("NO");
  exit(0);
}
inline bool is_vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < (4 * n); i++) {
    cin >> s[i];
    int c = 0, pos = -1;
    for (int j = ((int)(s[i]).size()) - 1; j >= 0; j--) {
      if (is_vowel(s[i][j])) c++;
      if (c == k) {
        pos = j;
        break;
      }
    }
    if (pos == -1) nope();
    s[i] = s[i].substr(pos);
  }
  bool aabb = true, abab = true, abba = true;
  for (int i = 0; i < (n); i++) {
    aabb &= (s[4 * i] == s[4 * i + 1] && s[4 * i + 2] == s[4 * i + 3]);
    abab &= (s[4 * i] == s[4 * i + 2] && s[4 * i + 1] == s[4 * i + 3]);
    abba &= (s[4 * i] == s[4 * i + 3] && s[4 * i + 1] == s[4 * i + 2]);
  }
  if (aabb && abab && abba)
    puts("aaaa");
  else if (aabb)
    puts("aabb");
  else if (abab)
    puts("abab");
  else if (abba)
    puts("abba");
  else
    nope();
  return 0;
}
