#include <bits/stdc++.h>
using namespace std;
string s[4];
int t, n, k;
int pd[4][4];
map<char, int> mp;
char ss;
bool xd(string s1, string s2) {
  int l1, l2;
  int tt = 0;
  l1 = s1.size() - 1;
  l2 = s2.size() - 1;
  while (l1 >= 0 && tt < k) {
    if (mp[s1[l1]]) {
      tt++;
    }
    l1--;
  }
  if (tt < k) {
    return 0;
  }
  tt = 0;
  while (l2 >= 0 && tt < k) {
    if (mp[s2[l2]]) {
      tt++;
    }
    l2--;
  }
  if (tt < k) {
    return 0;
  }
  return s1.substr(l1 + 1) == s2.substr(l2 + 1);
}
int main() {
  ss = 'a';
  mp[ss] = 1;
  ss = 'e';
  mp[ss] = 1;
  ss = 'i';
  mp[ss] = 1;
  ss = 'o';
  mp[ss] = 1;
  ss = 'u';
  mp[ss] = 1;
  cin >> n >> k;
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < 4; y++) {
      cin >> s[y];
    }
    for (int y = 0; y < 4; y++) {
      for (int z = 0; z < y; z++) {
        if (!xd(s[y], s[z])) {
          pd[y][z] = 1;
          pd[z][y] = 1;
        }
      }
    }
  }
  int an = 0;
  for (int x = 0; x < 4; x++) {
    for (int y = 0; y < 4; y++) {
      an += pd[x][y];
    }
  }
  if (!an) {
    cout << "aaaa" << endl;
  } else if (!pd[0][1] && !pd[2][3]) {
    cout << "aabb" << endl;
  } else if (!pd[0][2] && !pd[1][3]) {
    cout << "abab" << endl;
  } else if (!pd[0][3] && !pd[1][2]) {
    cout << "abba" << endl;
  } else {
    cout << "NO" << endl;
  }
}
