#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const int xx[4] = {1, -1, 0, 0};
const int yy[4] = {0, 0, 1, -1};
int inline nextin() {
  int t;
  if (scanf("%d", &t) != 1) exit(0);
  return t;
}
int inline in() {
  int x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
int n, k;
const string res[4] = {"aaaa", "aabb", "abab", "abba"};
string buf[4];
bool vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
void nope() {
  puts("NO");
  exit(0);
}
void peel(string &s) {
  int i = ((int)(s).size()) - 1, c = 0;
  for (; i >= 0 && c < k; i--) {
    if (vowel(s[i])) c++;
  }
  if (c < k) nope();
  s = s.substr(i + 1);
}
int type() {
  if (buf[0] == buf[1] && buf[1] == buf[2] && buf[2] == buf[3]) return 0;
  if (buf[0] == buf[1] && buf[2] == buf[3]) return 1;
  if (buf[0] == buf[2] && buf[1] == buf[3]) return 2;
  if (buf[0] == buf[3] && buf[1] == buf[2]) return 3;
  nope();
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  set<int> Set;
  for (int t = 0; t < (n); t++) {
    for (int i = 0; i < (4); i++) {
      cin >> buf[i];
      peel(buf[i]);
    }
    Set.insert(type());
  }
  if (((int)(Set).size()) > 1) {
    if (((int)(Set).size()) == 2 && *Set.begin() == 0)
      Set.erase(Set.begin());
    else
      nope();
  }
  cout << res[*Set.begin()] << endl;
  return 0;
}
