#include <bits/stdc++.h>
using namespace std;
string getSuffix(const string &str, int k) {
  int len = str.length();
  int Count = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' ||
        str[i] == 'u')
      Count++;
    if (Count == k) return str.substr(i);
  }
  return "";
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<string> S(4 * n);
  for (int i = 0; i < 4 * n; i++) {
    string str;
    cin >> str;
    S[i] = getSuffix(str, k);
    if (S[i] == "") {
      cout << "NO\n";
      return 0;
    }
  }
  int AABB = 0, ABAB = 0, ABBA = 0, AAAA = 0;
  for (int i = 0; i < n; i++) {
    bool X[4][4];
    for (int x = 0; x < 4; x++)
      for (int y = x + 1; y < 4; y++) X[x][y] = S[4 * i + x] == S[4 * i + y];
    if (X[0][1] && X[2][3]) AABB++;
    if (X[0][2] && X[1][3]) ABAB++;
    if (X[0][3] && X[1][2]) ABBA++;
    if (X[0][1] && X[0][2] && X[0][3]) AAAA++;
  }
  if (AAAA == n)
    cout << "aaaa" << endl;
  else if (AABB == n)
    cout << "aabb" << endl;
  else if (ABAB == n)
    cout << "abab" << endl;
  else if (ABBA == n)
    cout << "abba" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
