#include <bits/stdc++.h>
int n, k, pos[4], vow[31];
;
char s[4][11000];
int kind() {
  int i, j;
  for (i = 0; i < 4; i++) {
    int h = k, len = strlen(s[i]);
    while (len--) {
      if (vow[s[i][len] - 'a']) h--;
      if (h == 0) {
        pos[i] = len;
        break;
      }
    }
    if (h > 0) return 5;
  }
  if (strcmp(&s[0][pos[0]], &s[1][pos[1]]) == 0 &&
      strcmp(&s[2][pos[2]], &s[3][pos[3]]) == 0)
    return strcmp(&s[0][pos[0]], &s[2][pos[2]]) == 0 ? 4 : 1;
  if (strcmp(&s[0][pos[0]], &s[2][pos[2]]) == 0 &&
      strcmp(&s[1][pos[1]], &s[3][pos[3]]) == 0)
    return strcmp(&s[1][pos[1]], &s[2][pos[2]]) == 0 ? 4 : 2;
  if (strcmp(&s[0][pos[0]], &s[3][pos[3]]) == 0 &&
      strcmp(&s[2][pos[2]], &s[1][pos[1]]) == 0)
    return strcmp(&s[0][pos[0]], &s[2][pos[2]]) == 0 ? 4 : 3;
  return 5;
}
int main() {
  memset(vow, 0, sizeof(vow));
  vow['a' - 'a'] = vow['e' - 'a'] = vow['i' - 'a'] = vow['o' - 'a'] =
      vow['u' - 'a'] = 1;
  bool finish = false;
  scanf("%d %d", &n, &k);
  int tmp, ans = 4;
  while (n--) {
    for (int i = 0; i < 4; i++) scanf("%s", s[i]);
    if (finish) break;
    tmp = kind();
    if (ans == 4 || tmp == 4 || ans == tmp)
      ans = (tmp == 4 ? ans : tmp);
    else
      finish = true;
  }
  if (finish || ans == 5)
    printf("NO\n");
  else if (ans == 1)
    printf("aabb\n");
  else if (ans == 2)
    printf("abab\n");
  else if (ans == 3)
    printf("abba\n");
  else
    printf("aaaa\n");
  return 0;
}
