#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
clock_t clk = clock();
using namespace std;
int i, j;
void solve(void);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
bool compute(string sch, string s[][4], int n, int k, int ind) {
  string str[4];
  for (i = 0; i <= 3; ++i) {
    int ct = 0;
    for (j = s[ind][i].length() - 1; j >= 0; --j) {
      if (s[ind][i][j] == 'a' || s[ind][i][j] == 'e' || s[ind][i][j] == 'i' ||
          s[ind][i][j] == 'o' || s[ind][i][j] == 'u') {
        ct++;
        str[i] += s[ind][i][j];
      } else
        str[i] += s[ind][i][j];
      if (ct == k) break;
    }
    if (ct != k) return 0;
  }
  if (sch == "aabb")
    if (str[0] == str[1] && str[2] == str[3])
      return 1;
    else
      return 0;
  else if (sch == "abab")
    if (str[0] == str[2] && str[1] == str[3])
      return 1;
    else
      return 0;
  else if (sch == "abba")
    if (str[0] == str[3] && str[1] == str[2])
      return 1;
    else
      return 0;
}
unordered_map<string, bool> m;
void solve() {
  int n, k;
  cin >> n >> k;
  string s[n][4];
  for (i = 0; i <= n - 1; ++i)
    for (j = 0; j <= 3; ++j) cin >> s[i][j];
  int l;
  vector<string> v;
  for (l = 0; l <= n - 1; ++l) {
    long long int ct = 0;
    string scheme;
    if (compute("abab", s, n, k, l) == 1) {
      scheme = "abab";
      ++ct;
    }
    if (compute("aabb", s, n, k, l) == 1) {
      scheme = "aabb";
      ++ct;
    }
    if (compute("abba", s, n, k, l) == 1) {
      scheme = "abba";
      ++ct;
    }
    if (ct == 3)
      v.push_back("aaaa");
    else if (ct == 1)
      v.push_back(scheme);
    else
      v.push_back("NO");
  }
  long long int dif = 0;
  string scheme;
  for (i = 0; i <= n - 1; ++i)
    if (m[v[i]] == 0 && v[i] != "aaaa") {
      ++dif;
      scheme = v[i];
      m[v[i]] = 1;
    }
  if (dif > 1)
    cout << "\nNO";
  else if (dif == 1)
    cout << "\n" << scheme;
  else if (dif == 0)
    cout << "\naaaa";
}
