#include <bits/stdc++.h>
int diru[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dirv[] = {-1, 0, 1, -1, 1, -1, 0, 1};
using namespace std;
template <class T>
T sq(T n) {
  return n * n;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
bool inside(T a, T b, T c) {
  return a <= b && b <= c;
}
template <class T>
void setmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void setmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
int k, l;
string in[4 * 2510];
bool rime[4 * 2510][10];
bool isrime(int i, int j) {
  int la = ((int)in[i].size()), cnt = k;
  while (1) {
    la--;
    if (la < 0) return 0;
    if (in[i][la] == 'a' || in[i][la] == 'e' || in[i][la] == 'i' ||
        in[i][la] == 'o' || in[i][la] == 'u')
      cnt--;
    if (cnt == 0) break;
  }
  int lb = ((int)in[j].size());
  cnt = k;
  while (1) {
    lb--;
    if (lb < 0) return 0;
    if (in[j][lb] == 'a' || in[j][lb] == 'e' || in[j][lb] == 'i' ||
        in[j][lb] == 'o' || in[j][lb] == 'u')
      cnt--;
    if (cnt == 0) break;
  }
  for (; la < ((int)in[i].size()) && lb < ((int)in[j].size()); la++, lb++) {
    if (in[i][la] != in[j][lb]) return 0;
  }
  if (la == ((int)in[i].size()) && lb == ((int)in[j].size())) return 1;
  return 0;
}
bool chkk(int r) {
  int i;
  for (i = 0; i < l; i++) {
    if (rime[i][r] == 0) return 0;
  }
  return 1;
}
char tmp[100010];
int main() {
  int n, T, t = 1, m, i, j;
  while (scanf("%d", &n) == 1) {
    scanf("%d", &k);
    n *= 4;
    for (i = 0; i < n; i++) {
      scanf("%s", tmp);
      in[i] = tmp;
    }
    memset(rime, 0, sizeof(rime));
    l = 0;
    for (i = 0; i < n; i++) {
      if (isrime(i, i + 1) && isrime(i + 2, i + 3)) rime[l][0] = 1;
      if (isrime(i, i + 2) && isrime(i + 1, i + 3)) rime[l][1] = 1;
      if (isrime(i, i + 3) && isrime(i + 1, i + 2)) rime[l][2] = 1;
      if (rime[l][0] && rime[l][1] && rime[l][2]) rime[l][3] = 1;
      i += 3;
      l++;
    }
    if (chkk(3))
      puts("aaaa");
    else if (chkk(0))
      puts("aabb");
    else if (chkk(1))
      puts("abab");
    else if (chkk(2))
      puts("abba");
    else
      puts("NO");
  }
  return 0;
}
