#include <bits/stdc++.h>
using namespace std;
int n, k;
string s[4];
int ans = 3;
set<char> o;
int main() {
  o.insert('a');
  o.insert('e');
  o.insert('i');
  o.insert('o');
  o.insert('u');
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) cin >> s[j];
    vector<string> z(4);
    for (int j = 0; j < 4; ++j) {
      int tmpcol = 0;
      for (int t = s[j].size() - 1; t >= 0; --t) {
        if (o.find(s[j][t]) != o.end()) ++tmpcol;
        z[j].push_back(s[j][t]);
        if (tmpcol == k) break;
      }
      if (tmpcol < k) {
        cout << "NO" << endl;
        return 0;
      }
    }
    if (z[0] == z[1] && z[2] == z[3] && z[1] == z[2]) continue;
    int tmpans = -1;
    if (z[0] == z[1] && z[2] == z[3])
      tmpans = 0;
    else if (z[0] == z[2] && z[1] == z[3])
      tmpans = 1;
    else if (z[0] == z[3] && z[1] == z[2])
      tmpans = 2;
    if (tmpans == -1) {
      cout << "NO" << endl;
      return 0;
    }
    if (ans == 3)
      ans = tmpans;
    else if (ans != tmpans) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (ans == 0) cout << "aabb" << endl;
  if (ans == 1) cout << "abab" << endl;
  if (ans == 2) cout << "abba" << endl;
  if (ans == 3) cout << "aaaa" << endl;
  return 0;
}
