#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 25 * 100 + 10;
const int MAX_L = 1e4 + 10;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x * f;
}
string S[4 * MAX_N];
int N, K;
bool AABB = 1, ABAB = 1, ABBA = 1, AAAA = 1;
char buf[MAX_L];
inline bool vowel(char c) {
  return c == 'a' || c == 'u' || c == 'o' || c == 'i' || c == 'e';
}
inline int get_pos(string s) {
  int cnt = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (vowel(s[i])) cnt++;
    if (cnt == K) return i;
  }
  return -1;
}
signed main() {
  N = read();
  K = read();
  N *= 4;
  for (int i = 0; i < N; i++) {
    scanf("%s", buf);
    string now = buf;
    int idx = get_pos(now);
    S[i] = "";
    if (idx < 0)
      S[i] += char('0' + i % 4);
    else
      S[i] = now.substr(idx);
  }
  for (int i = 0; i < N; i += 4) {
    AABB &= S[i] == S[i + 1] and S[i + 2] == S[i + 3];
    ABAB &= S[i] == S[i + 2] and S[i + 1] == S[i + 3];
    ABBA &= S[i] == S[i + 3] and S[i + 1] == S[i + 2];
  }
  if (ABBA and ABAB and AABB)
    puts("aaaa");
  else if (ABBA)
    puts("abba");
  else if (ABAB)
    puts("abab");
  else if (AABB)
    puts("aabb");
  else
    puts("NO");
  return 0;
}
