#include <bits/stdc++.h>
using namespace std;
int n, k;
char a[4][100000];
int c[4];
int b[3000];
bool is(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  return false;
}
int i, j, m;
int main() {
  scanf("%d%d", &n, &k);
  bool flag = true;
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 4; j++) {
      scanf("%s", a[j]);
      int len = strlen(a[j]);
      int num = 0;
      for (int r = len - 1; r >= 0; r--) {
        if (is(a[j][r])) {
          num++;
          if (num == k) {
            c[j] = r;
            break;
          }
        }
      }
      if (num < k) flag = false;
    }
    if (flag) {
      if (strcmp(a[0] + c[0], a[1] + c[1]) == 0 &&
          strcmp(a[1] + c[1], a[2] + c[2]) == 0 &&
          strcmp(a[2] + c[2], a[3] + c[3]) == 0)
        b[i] = 0;
      else if (strcmp(a[0] + c[0], a[1] + c[1]) == 0 &&
               strcmp(a[3] + c[3], a[2] + c[2]) == 0)
        b[i] = 1;
      else if (strcmp(a[0] + c[0], a[2] + c[2]) == 0 &&
               strcmp(a[1] + c[1], a[3] + c[3]) == 0)
        b[i] = 2;
      else if (strcmp(a[0] + c[0], a[3] + c[3]) == 0 &&
               strcmp(a[1] + c[1], a[2] + c[2]) == 0)
        b[i] = 3;
      else
        flag = false;
    }
  }
  int sta = 0;
  for (i = 1; i <= n; i++) {
    if (b[i] != 0 && sta == 0) sta = b[i];
    if (b[i] != sta && b[i] != 0) {
      flag = false;
    }
  }
  if (!flag)
    printf("NO\n");
  else if (sta == 1)
    printf("aabb\n");
  else if (sta == 2)
    printf("abab\n");
  else if (sta == 0)
    printf("aaaa\n");
  else
    printf("abba\n");
  return 0;
}
