#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(const T& x) {
  return x * x;
}
template <class T>
inline void checkmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T& a, T b) {
  if (b > a) a = b;
}
const double eps = 1e-8;
inline int dcmp(double x) { return x < -eps ? -1 : x > eps; }
inline bool deq(double x, double y) { return dcmp(x - y) == 0; }
inline bool dleq(double x, double y) { return dcmp(x - y) <= 0; }
int n, k;
string vw = "aeiou";
char buff[10001];
string c1, c2, c3, c4;
bool isvowel(char c) {
  return (find((vw).begin(), (vw).end(), c) != (vw).end());
}
bool rythm(string& s1, string& s2) {
  if (s1 != s2) return false;
  int ctv = 0;
  for (typeof((s1).begin()) ch = (s1).begin(); ch != (s1).end(); ch++)
    ctv += isvowel(*ch);
  if (ctv != k) return false;
  return true;
}
string getfivevowels() {
  scanf("%s", buff);
  int len = strlen(buff), ct = 0;
  string res = "";
  for (int i = len - 1; i >= 0; i--) {
    res += buff[i];
    if (isvowel(buff[i])) ct++;
    if (ct == k) return res;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &k);
  vector<bool> mark(4, true);
  while (n--) {
    c1 = getfivevowels();
    c2 = getfivevowels();
    c3 = getfivevowels();
    c4 = getfivevowels();
    if (!rythm(c1, c2)) {
      mark[0] = false;
      mark[1] = false;
    }
    if (!rythm(c3, c4)) {
      mark[0] = false;
      mark[1] = false;
    }
    if (!rythm(c1, c3)) {
      mark[0] = false;
      mark[2] = false;
    }
    if (!rythm(c2, c4)) {
      mark[0] = false;
      mark[2] = false;
    }
    if (!rythm(c1, c4)) {
      mark[0] = false;
      mark[3] = false;
    }
    if (!rythm(c2, c3)) {
      mark[0] = false;
      mark[3] = false;
    }
    int ct = 0;
    for (int i = 0; i < 4; i++) ct += mark[i];
    if (ct == 0) {
      printf("NO\n");
      return 0;
    }
  }
  if (mark[0])
    printf("aaaa\n");
  else if (mark[1])
    printf("aabb\n");
  else if (mark[2])
    printf("abab\n");
  else if (mark[3])
    printf("abba\n");
  else
    printf("NO\n");
  return 0;
}
