#include <bits/stdc++.h>
using namespace std;
string input[2500][4];
int n, k;
string v("aeiou");
string p[4];
bool check(int s, string& cres) {
  string suff[4];
  for (int i = 0; i < 4; i++) {
    int ck = 0;
    int j;
    for (j = input[s][i].length() - 1; j >= 0; j--)
      if (v.find(input[s][i][j]) != -1) {
        ck++;
        if (ck == k) break;
      }
    if (ck == k)
      suff[i] = input[s][i].substr(j);
    else
      return false;
  }
  if (suff[0] == suff[1] && suff[1] == suff[2] && suff[2] == suff[3]) {
    cres = p[0];
    return true;
  }
  if (suff[0] == suff[2] && suff[1] == suff[3]) {
    cres = p[1];
    return true;
  }
  if (suff[0] == suff[3] && suff[1] == suff[2]) {
    cres = p[2];
    return true;
  }
  if (suff[0] == suff[1] && suff[2] == suff[3]) {
    cres = p[3];
    return true;
  }
  return false;
}
int main() {
  p[0] = string("aaaa");
  p[1] = string("abab");
  p[2] = string("abba");
  p[3] = string("aabb");
  cin >> n >> k;
  string res("aaaa");
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 4; j++) cin >> input[i][j];
  for (int i = 0; i < n; i++) {
    string cres;
    if (!check(i, cres)) {
      cout << "NO" << endl;
      return 0;
    }
    if (cres == res)
      continue;
    else if (cres == p[0])
      continue;
    else if (res == p[0])
      res = cres;
    else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << res << endl;
  return 0;
}
