#include <bits/stdc++.h>
using namespace std;
int n, k;
bool vis[200];
string rhyme(vector<string> &v) {
  vector<string> r;
  for (int i = 0; i < 4; i++) {
    string tmp1 = "", tmp2 = "";
    tmp1 = v[i];
    int c = 0;
    for (int j = tmp1.size() - 1; j >= 0; j--) {
      if (vis[tmp1[j]]) c++;
      tmp2.push_back(tmp1[j]);
      if (c == k) break;
    }
    if (c == k) r.push_back(tmp2);
  }
  if (r.size() < 4) return ".";
  if (r[0] == r[1] && r[1] == r[2] && r[2] == r[3])
    return "aaaa";
  else if (r[0] == r[1] && r[2] == r[3])
    return "aabb";
  else if (r[0] == r[2] && r[1] == r[3])
    return "abab";
  else if (r[0] == r[3] && r[1] == r[2])
    return "abba";
  else
    return ".";
}
int main() {
  cin >> n >> k;
  string ans = "";
  vis['a'] = vis['e'] = 1;
  vis['i'] = vis['o'] = 1;
  vis['u'] = 1;
  for (int i = 0; i < n; i++) {
    vector<string> v(4);
    cin >> v[0] >> v[1];
    cin >> v[2] >> v[3];
    string t = rhyme(v);
    if (t == ".")
      return cout << "NO" << endl, 0;
    else if (ans == "")
      ans = t;
    else if (t == "aaaa")
      continue;
    else if (t != ans && ans != "aaaa")
      return cout << "NO" << endl, 0;
    else if (t != ans)
      ans = t;
  }
  if (ans != "")
    cout << ans << endl;
  else
    cout << "NO" << endl;
  return 0;
}
