#include <bits/stdc++.h>
using namespace std;
int read(int &n) { return scanf("%d", &n); }
int read(unsigned int &n) { return scanf("%u", &n); }
int read(long long &n) { return scanf("%lld", &n); }
int read(unsigned long long &n) { return scanf("%llu", &n); }
int read(double &n) { return scanf("%lf", &n); }
int read(long double &n) { return scanf("%Lf", &n); }
int read(char *c) { return scanf("%s", c); }
int n, k;
string s[10010], su[10010];
bool suf(const string &s, string &t) {
  int k2 = k;
  t = "";
  for (int i = s.size() - 1; i >= 0; i--) {
    if ((s[i] == 'a' or s[i] == 'i' or s[i] == 'u' or s[i] == 'e' or
         s[i] == 'o'))
      k2--;
    t += s[i];
    if (k2 == 0) return true;
  }
  return false;
}
string var[] = {"aabb", "abab", "abba", "aaaa"};
bool match(int i, const string &t) {
  vector<string> vs;
  for (int j = 0; j < (int)(4); ++j) {
    string su;
    suf(s[i], su);
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < (int)(n * 4); ++i) cin >> s[i];
  bool valid = true;
  for (int i = 0; i < (int)(n * 4); ++i) {
    valid &= suf(s[i], su[i]);
  }
  if (!valid) {
    cout << "NO";
    return 0;
  }
  do {
    bool valid = true;
    for (int j = 0; j < (int)(n); ++j) {
      if (not(su[j * 4] == su[j * 4 + 1] and su[j * 4 + 1] == su[j * 4 + 2] and
              su[j * 4 + 2] == su[j * 4 + 3]))
        valid = false;
    }
    if (valid) {
      cout << "aaaa";
      return 0;
    }
  } while (0);
  do {
    bool valid = true;
    for (int j = 0; j < (int)(n); ++j) {
      if (not(su[j * 4] == su[j * 4 + 3] and su[j * 4 + 1] == su[j * 4 + 2]))
        valid = false;
    }
    if (valid) {
      cout << "abba";
      return 0;
    }
  } while (0);
  do {
    bool valid = true;
    for (int j = 0; j < (int)(n); ++j) {
      if (not(su[j * 4] == su[j * 4 + 1] and su[j * 4 + 2] == su[j * 4 + 3]))
        valid = false;
    }
    if (valid) {
      cout << "aabb";
      return 0;
    }
  } while (0);
  do {
    bool valid = true;
    for (int j = 0; j < (int)(n); ++j) {
      if (not(su[j * 4] == su[j * 4 + 2] and su[j * 4 + 1] == su[j * 4 + 3]))
        valid = false;
    }
    if (valid) {
      cout << "abab";
      return 0;
    }
  } while (0);
  cout << "NO";
  return 0;
}
