#include <bits/stdc++.h>
int v[5], k;
char s[4][10001];
bool isvwl(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
bool rym(int a, int b) {
  int len1 = strlen(s[a]), len2 = strlen(s[b]), counter = 0;
  for (int i = len1 - 1, j = len2 - 1; i >= 0 && j >= 0; i--, j--) {
    if (s[a][i] != s[b][j])
      break;
    else if (isvwl(s[a][i]))
      counter++;
    if (counter == k) return true;
  }
  return false;
}
bool checkAABB() {
  if (rym(0, 1) && rym(2, 3)) {
    v[0]++;
    return true;
  }
  return false;
}
bool checkABAB() {
  if (rym(0, 2) && rym(1, 3)) {
    v[1]++;
    return true;
  }
  return false;
}
bool checkABBA() {
  if (rym(0, 3) && rym(1, 2)) {
    v[2]++;
    return true;
  }
  return false;
}
void checkAAAA() {
  bool ret = true;
  ret &= checkABBA();
  ret &= checkABAB();
  ret &= checkAABB();
  if (ret) v[3]++;
}
int main() {
  int n;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s[0]);
    scanf("%s", s[1]);
    scanf("%s", s[2]);
    scanf("%s", s[3]);
    checkAAAA();
  }
  if (v[3] == n)
    printf("aaaa");
  else if (v[0] == n)
    printf("aabb");
  else if (v[1] == n)
    printf("abab");
  else if (v[2] == n)
    printf("abba");
  else
    printf("NO");
  return 0;
}
