#include <bits/stdc++.h>
using namespace std;
bool f[2510][5];
int n, k;
bool Is(char x) {
  if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') return 1;
  return 0;
}
bool NO;
char *judge(char *c) {
  if (NO) return NULL;
  int l = strlen(c), t = 0;
  for (int i = l - 1; i >= 0; --i) {
    if (Is(c[i])) {
      t++;
      if (t == k) return c + i;
    }
  }
  NO = 1;
  return NULL;
}
int main() {
  int i, j;
  while (cin >> n >> k) {
    memset(f, 0, sizeof(f));
    ;
    NO = 0;
    for (i = 1; i <= n; ++i) {
      char c1[10020], c2[10020], c3[10020], c4[10020];
      scanf("%s%s%s%s", c1, c2, c3, c4);
      if (NO) continue;
      char *s1 = judge(c1);
      char *s2 = judge(c2);
      char *s3 = judge(c3);
      char *s4 = judge(c4);
      if (NO) continue;
      if (!strcmp(s1, s2) && !strcmp(s3, s4)) f[i][1] = 1;
      if (!strcmp(s1, s3) && !strcmp(s2, s4)) f[i][2] = 1;
      if (!strcmp(s1, s4) && !strcmp(s2, s3)) f[i][3] = 1;
      if (!strcmp(s1, s2) && !strcmp(s2, s3) && !strcmp(s3, s4)) f[i][4] = 1;
    }
    if (NO) {
      puts("NO");
      continue;
    }
    NO = 1;
    for (i = 4; i > 0; --i) {
      for (j = 1; j <= n; ++j)
        if (!f[j][i]) break;
      if (j > n) {
        if (i == 1) puts("aabb");
        if (i == 2) puts("abab");
        if (i == 3) puts("abba");
        if (i == 4) puts("aaaa");
        NO = 0;
        break;
      }
    }
    if (NO) puts("NO");
  }
}
