#include <bits/stdc++.h>
using namespace std;
string s[100005];
set<char> uno = {'a', 'e', 'i', 'o', 'u'};
string getSuffix(string a, int k) {
  int cnt = a.length() - 1;
  for (int j = (a.length() - 1); j >= (0); --j) {
    if (uno.count(a[j])) k--;
    if (!k) break;
    cnt--;
  }
  if (k) return "NA";
  return a.substr(cnt, a.length() - cnt);
}
int main() {
  ios::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(20);
  int n, k;
  cin >> n >> k;
  vector<string> store;
  set<string> mys;
  for (int i = (1); i <= (4 * n); ++i) cin >> s[i];
  set<string> ans;
  for (int i = 1; i <= 4 * n; i += 4) {
    store.clear();
    mys.clear();
    for (int j = (0); j <= (3); ++j) {
      string tmp = getSuffix(s[i + j], k);
      if (tmp == "NA") return 0 * puts("NO");
      store.push_back(tmp), mys.insert(tmp);
    }
    if (mys.size() > 2)
      return 0 * puts("NO");
    else if (mys.size() == 2) {
      if (store[0] == store[1] && store[2] == store[3])
        ans.insert("aabb");
      else if (store[0] == store[2] && store[1] == store[3])
        ans.insert("abab");
      else if (store[0] == store[3] && store[1] == store[2])
        ans.insert("abba");
      else
        return 0 * puts("NO");
    }
  }
  if (ans.size() == 0)
    return 0 * puts("aaaa");
  else if (ans.size() == 1)
    cout << *ans.begin() << '\n';
  else
    puts("NO");
  return 0;
}
