#include <bits/stdc++.h>
using namespace std;
char lett[5][5] = {{"aaaa"}, {"aabb"}, {"abab"}, {"abba"}, {"NO"}};
bool outt[5];
char ler[5][8];
int lern[5][8];
char lets[4][10000 + 10];
int main() {
  char str[10000 + 10];
  int n, k, len;
  int i, j, p, t, q;
  while (scanf("%d%d", &n, &k) != EOF) {
    getchar();
    memset(outt, true, sizeof(outt));
    for (i = 0; i < n; i++) {
      for (j = 0; j < 4; j++) {
        scanf("%s", &str);
        len = strlen(str);
        t = k;
        q = 0;
        for (p = len - 1; p >= 0 && t > 0; p--) {
          lets[j][q++] = str[p];
          if (str[p] == 'a' || str[p] == 'e' || str[p] == 'i' ||
              str[p] == 'o' || str[p] == 'u') {
            t--;
          }
        }
        lets[j][q] = '\0';
        if (t > 0) {
          outt[0] = false;
          outt[1] = false;
          outt[2] = false;
          outt[3] = false;
        }
      }
      if (strcmp(lets[0], lets[1]) != 0 || strcmp(lets[1], lets[2]) != 0 ||
          strcmp(lets[2], lets[3]) != 0)
        outt[0] = false;
      if (strcmp(lets[0], lets[1]) != 0 || strcmp(lets[2], lets[3]) != 0)
        outt[1] = false;
      if (strcmp(lets[0], lets[2]) != 0 || strcmp(lets[1], lets[3]) != 0)
        outt[2] = false;
      if (strcmp(lets[0], lets[3]) != 0 || strcmp(lets[1], lets[2]) != 0)
        outt[3] = false;
    }
    for (i = 0; i <= 5; i++) {
      if (outt[i]) {
        printf("%s\n", lett[i]);
        break;
      }
    }
  }
  return 0;
}
