#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
string suffix(string s, long long k) {
  long long l = s.length();
  long long cnt = 0;
  for (long long i = l - 1; i >= 0; i--) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'o' || s[i] == 'i' || s[i] == 'u')
      cnt++;
    if (cnt == k) {
      return s.substr(i);
    }
  }
  string t = "-1";
  return t;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long flag = 0;
  string prev = "aaaa";
  for (long long i = 0; i < n; i++) {
    string a, b, c, d;
    cin >> a >> b >> c >> d;
    string x = suffix(a, k);
    string y = suffix(b, k);
    string z = suffix(c, k);
    string w = suffix(d, k);
    if (x == "-1" || y == "-1" || z == "-1" || w == "-1") {
      flag = 1;
      continue;
    }
    string scheme = "";
    if (x == y && z == w && y == z)
      scheme = "aaaa";
    else if (x == y && z == w)
      scheme = "aabb";
    else if (x == z && y == w)
      scheme = "abab";
    else if (x == w && y == z)
      scheme = "abba";
    else
      flag = 1;
    if (prev == "aaaa")
      prev = scheme;
    else if (scheme == "aaaa" || scheme == prev)
      continue;
    else
      flag = 1;
  }
  if (flag)
    cout << "NO"
         << "\n";
  else
    cout << prev << "\n";
  return 0;
}
