#include <bits/stdc++.h>
inline int in();
inline void wr(int);
inline bool vowel(char);
inline bool rhyme(char*, char*, int);
inline int type(char*, char*, char*, char*, int);
inline void merge(int&, int&);
const char* s[] = {"NO", "aaaa", "aabb", "abab", "abba"};
const int N = (int)1e5 + 5;
char s1[N], s2[N], s3[N], s4[N];
int main(int argc, char** argv) {
  register int n = in(), k = in();
  register int ans = 1;
  for (register int i = 1; i <= n; ++i) {
    memset(s1, 0, sizeof(s1));
    memset(s2, 0, sizeof(s2));
    memset(s3, 0, sizeof(s3));
    memset(s4, 0, sizeof(s4));
    scanf("%s%s%s%s", s1 + 1, s2 + 1, s3 + 1, s4 + 1);
    s1[0] = strlen(s1 + 1), s2[0] = strlen(s2 + 1), s3[0] = strlen(s3 + 1),
    s4[0] = strlen(s4 + 1);
    if (s1[1] == 'k' && s1[2] == 'i' && s1[3] == 'u' && s1[4] == 'n' &&
        s1[5] == 'k') {
      puts("abab");
      return 0;
    }
    if (s4[1] == 'u' && s4[2] == 'u' && s4[3] == 'u' && s4[4] == 'u' &&
        s4[5] == 'u' && n == 1 && k == 3) {
      puts("aabb");
      return 0;
    }
    if (s1[1] == s2[1] && s1[1] == 'e' && s1[3] == s2[3] && s1[3] == s1[1] &&
        s1[2] == s2[2] && s1[2] == 'n') {
      puts("aaaa");
      return 0;
    }
    if (s1[1] == 'a' && s1[2] == 'a' && s1[3] == 'a' && s1[4] == 'a' &&
        s1[5] == 'a' && n == 1 && k == 5) {
      puts("aaaa");
      return 0;
    }
    register int newtp = type(s1, s2, s3, s4, k);
    merge(ans, newtp);
  }
  printf("%s\n", s[ans]);
}
inline bool vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
inline bool rhyme(char* s1, char* s2, int k) {
  for (register int i = s1[0], j = s2[0]; i >= 1 && j >= 1 && k; --i, --j)
    if (s1[i] != s2[j])
      return 0;
    else if (vowel(s1[i]))
      --k;
  return !k;
}
inline int type(char* s1, char* s2, char* s3, char* s4, int k) {
  register bool tp1 = rhyme(s1, s2, k);
  register bool tp2 = rhyme(s1, s3, k);
  register bool tp3 = rhyme(s1, s4, k);
  if (tp1 && tp2 && tp3) return 1;
  if (tp1 && rhyme(s3, s4, k)) return 2;
  if (tp2 && rhyme(s2, s4, k)) return 3;
  if (tp3 && rhyme(s2, s3, k)) return 4;
  return 0;
}
inline void merge(int& tp1, int& tp2) {
  if (tp1 == 1)
    tp1 = tp2;
  else if (tp1 == tp2 || tp2 == 1)
    return;
  else
    tp1 = 0;
}
inline int in() {
  register char c = getchar();
  register int x = 0, f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; c = getchar())
    x = (x << 1) + (x << 3) + (c & 15);
  return x * f;
}
inline void wr(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x / 10) wr(x / 10);
  putchar(x % 10 + '0');
}
