#include <bits/stdc++.h>
using namespace std;
bool is_glas(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
string get_suff(const string& s, int k) {
  for (int i = ((int)s.size()) - 1; i >= 0; --i) {
    if (is_glas(s[i])) {
      --k;
      if (k == 0) {
        return s.substr(i);
      }
    }
  }
  return "";
}
bool check_aabb(vector<string>& w) {
  for (int i = 0; i < ((int)w.size()); i += 4) {
    if (w[i] != w[i + 1]) return false;
    if (w[i + 2] != w[i + 3]) return false;
  }
  return true;
}
bool check_abba(vector<string>& w) {
  for (int i = 0; i < ((int)w.size()); i += 4) {
    if (w[i] != w[i + 3]) return false;
    if (w[i + 1] != w[i + 2]) return false;
  }
  return true;
}
bool check_abab(vector<string>& w) {
  for (int i = 0; i < ((int)w.size()); i += 4) {
    if (w[i] != w[i + 2]) return false;
    if (w[i + 1] != w[i + 3]) return false;
  }
  return true;
}
bool check_aaaa(vector<string>& w) {
  for (int i = 0; i < ((int)w.size()); i += 4) {
    if (w[i] != w[i + 1]) return false;
    if (w[i + 1] != w[i + 2]) return false;
    if (w[i + 2] != w[i + 3]) return false;
  }
  return true;
}
string find_type(vector<string>& w) {
  if (check_aaaa(w)) return "aaaa";
  if (check_abba(w)) return "abba";
  if (check_aabb(w)) return "aabb";
  if (check_abab(w)) return "abab";
  return "NO";
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<string> w;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) {
      string s;
      cin >> s;
      w.push_back(get_suff(s, k));
      if (w.back().empty()) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << find_type(w) << endl;
  return 0;
}
