#include <bits/stdc++.h>
int n, k;
char s[4][10003];
bool check(int i, int j) {
  int pi, pj;
  for (pi = 0; s[i][pi]; ++pi)
    ;
  for (pj = 0; s[j][pj]; ++pj)
    ;
  int left = k;
  while (left > 0) {
    if (--pi < 0) return false;
    if (--pj < 0) return false;
    if (s[i][pi] != s[j][pj]) return false;
    if (s[i][pi] == 'a' || s[i][pi] == 'e' || s[i][pi] == 'i' ||
        s[i][pi] == 'o' || s[i][pi] == 'u')
      left--;
  }
  return true;
}
int main() {
  scanf("%d %d\n", &n, &k);
  int total = 15;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) gets(s[j]);
    int mask = 1;
    for (int j = 1; j < 4; ++j)
      if (check(0, j)) mask |= (1 << j);
    if (mask == 15) continue;
    if (mask == 3 && check(2, 3)) {
      total &= 3;
      continue;
    }
    if (mask == 5 && check(1, 3)) {
      total &= 5;
      continue;
    }
    if (mask == 9 && check(1, 2)) {
      total &= 9;
      continue;
    }
    total = 0;
    break;
  }
  if (total == 3)
    printf("aabb\n");
  else if (total == 5)
    printf("abab\n");
  else if (total == 9)
    printf("abba\n");
  else if (total == 15)
    printf("aaaa\n");
  else
    printf("NO\n");
  return 0;
}
