#include <bits/stdc++.h>
using namespace std;
vector<int> aux;
int n, k;
char m[100][150];
bool vogal(char a) {
  return (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u');
}
bool igual(string a, int ida, string b, int idb) {
  if (a.length() - ida != b.length() - idb) return false;
  for (int i = ida; i < a.length(); i++)
    if (a[i] != b[i - ida + idb]) return false;
  return true;
}
int f(string a, string b, string c, string d) {
  int aa = 0, bb = 0, cc = 0, dd = 0;
  int ia, ib, ic, id;
  for (ia = a.length() - 1; ia >= 0 && aa < k; ia--)
    if (vogal(a[ia])) aa++;
  for (ib = b.length() - 1; ib >= 0 && bb < k; ib--)
    if (vogal(b[ib])) bb++;
  for (ic = c.length() - 1; ic >= 0 && cc < k; ic--)
    if (vogal(c[ic])) cc++;
  for (id = d.length() - 1; id >= 0 && dd < k; id--)
    if (vogal(d[id])) dd++;
  if (aa != k || bb != k || cc != k || dd != k) return -1;
  ia++, ib++, ic++, id++;
  if (igual(a, ia, b, ib) && igual(a, ia, c, ic) && igual(a, ia, d, id))
    return 4;
  if (igual(a, ia, b, ib) && igual(c, ic, d, id)) return 1;
  if (igual(a, ia, c, ic) && igual(b, ib, d, id)) return 2;
  if (igual(a, ia, d, id) && igual(b, ib, c, ic)) return 3;
  return -1;
}
int main() {
  string a, b, c, d;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    aux.push_back(f(a, b, c, d));
  }
  int q = 0, w = 0, e = 0, r = 0;
  bool ff = true;
  for (int i = 0; i < n; i++) {
    if (aux[i] == -1) {
      ff = false;
      break;
    }
    if (aux[i] == 1)
      q++;
    else if (aux[i] == 2)
      w++;
    else if (aux[i] == 3)
      e++;
    else
      r++;
  }
  if (ff == false)
    printf("NO\n");
  else if (q == 0 && w == 0 && e == 0)
    printf("aaaa\n");
  else if (w == 0 && e == 0)
    printf("aabb\n");
  else if (q == 0 && w == 0)
    printf("abba\n");
  else if (q == 0 && e == 0)
    printf("abab\n");
  else
    printf("NO\n");
  return 0;
}
