#include <bits/stdc++.h>
using namespace std;
int n, k;
char a[100500], b[100500], c[100500], d[100500];
bool vow(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
int go(char* s) {
  int n = strlen(s);
  int i = n, l = 0;
  while (i) {
    if (vow(s[i - 1])) l++;
    i--;
    if (l == k) break;
  }
  if (l != k) return -1;
  return i;
}
bool g(char* s, char* t) {
  int i = go(s), j = go(t);
  if (i < 0 || j < 0) return false;
  return !strcmp(s + i, t + j);
}
int main() {
  scanf("%d%d", &n, &k);
  bool b1 = 1, b2 = 1, b3 = 1;
  for (int i = 0; i < (n); i++) {
    scanf("%s", a);
    scanf("%s", b);
    scanf("%s", c);
    scanf("%s", d);
    if (!(g(a, b) && g(c, d))) b1 = 0;
    if (!(g(a, c) && g(b, d))) b2 = 0;
    if (!(g(a, d) && g(b, c))) b3 = 0;
  }
  if (!b1 && !b2 && !b3)
    printf("NO\n");
  else {
    if (b1 && b2) assert(b3);
    if (b1 && b3) assert(b2);
    if (b2 && b3) assert(b1);
    if (b1 && b2 && b3)
      printf("aaaa\n");
    else {
      if (b1)
        printf("aabb\n");
      else if (b2)
        printf("abab\n");
      else if (b3)
        printf("abba\n");
      else
        assert(false);
    }
  }
  return 0;
}
