#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = 1 << 30;
const int mod = 1000000007;
const int maxm = 1 + 5;
const int maxn = 1000000 + 5;
char cat[4][100000];
char s[4][100000];
int n, k;
bool bj;
bool fit(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'u' || ch == 'o')
    return true;
  return false;
}
void fun(int x) {
  int len = strlen(s[x]);
  int kk = 0, start = -1;
  for (int i = len - 1; i >= 0; i--) {
    if (fit(s[x][i])) kk++;
    if (kk == k) {
      start = i;
      break;
    }
  }
  if (kk != k)
    bj = false;
  else
    bj = true;
  for (int i = start; bj && i < len; i++) {
    cat[x][i - start] = s[x][i];
  }
  if (bj) cat[x][len - start] = '\0';
}
bool same(int i, int j) {
  if (strcmp(cat[i], cat[j]) == 0) return true;
  return false;
}
int cmp() {
  if (bj == false) return -1;
  if (same(0, 1) && same(1, 2) && same(2, 3)) return 0;
  if (same(0, 1) && same(2, 3)) return 1;
  if (same(0, 2) && same(1, 3)) return 2;
  if (same(0, 3) && same(1, 2)) return 3;
  return -1;
}
int main() {
  int ans = -2;
  scanf("%d %d", &n, &k);
  for (int i = (0), _b(n); i < _b; ++i) {
    for (int j = (0), _b(4); j < _b; ++j) {
      scanf("%s", s[j]);
      fun(j);
    }
    int p = cmp();
    if (ans == -1)
      continue;
    else if (ans == -2)
      ans = p;
    else if (ans == 0)
      ans = p;
    else {
      if (p == 0)
        continue;
      else if (ans != p)
        ans = -1;
    }
  }
  if (ans == -1)
    cout << "NO" << endl;
  else if (ans == 0)
    cout << "aaaa" << endl;
  else if (ans == 1)
    cout << "aabb" << endl;
  else if (ans == 2)
    cout << "abab" << endl;
  else if (ans == 3)
    cout << "abba" << endl;
  return 0;
}
