#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;
}
void nope() {
  puts("NO");
  exit(0);
}
string buf[4];
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  set<string> res;
  for (int t = 0; t < (n); t++) {
    for (int i = 0; i < (4); i++) {
      cin >> buf[i];
      int p = ((int)(buf[i]).size()), c = 0;
      while (p > 0 && c < k) {
        p--;
        if (buf[i][p] == 'a' || buf[i][p] == 'e' || buf[i][p] == 'i' ||
            buf[i][p] == 'o' || buf[i][p] == 'u')
          c++;
      }
      if (c < k) nope();
      buf[i] = buf[i].substr(p);
    }
    if (buf[0] == buf[1]) {
      if (buf[2] == buf[3]) {
        if (buf[1] == buf[2])
          res.insert("aaaa");
        else
          res.insert("aabb");
      } else
        nope();
    } else if (buf[0] == buf[2]) {
      if (buf[1] == buf[3])
        res.insert("abab");
      else
        nope();
    } else if (buf[0] == buf[3]) {
      if (buf[1] == buf[2])
        res.insert("abba");
      else
        nope();
    } else
      nope();
  }
  if (((int)(res).size()) > 1) {
    if (((int)(res).size()) == 2 && *res.begin() == "aaaa")
      res.erase(res.begin());
    else
      nope();
  }
  cout << *res.begin() << endl;
  return 0;
}
