#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
const int MM = 998244353;
const long double PI = acos(-1);
const long long INF = 2e18;
template <typename T, typename T1>
void amax(T &a, T1 b) {
  if (b > a) a = b;
}
template <typename T, typename T1>
void amin(T &a, T1 b) {
  if (b < a) a = b;
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
long long power(long long b, long long e, long long m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
long long modinv(long long a, long long m) { return power(a, m - 2, m); }
int TLE_TERROR() {
  long long n, k;
  cin >> n >> k;
  string s, a, b, c, d;
  vector<string> v, w, ans;
  for (long long i = 0; i < (4 * n); i++) {
    cin >> s;
    reverse((s).begin(), (s).end());
    v.push_back(s);
  }
  for (long long i = 0; i < v.size(); i += 4) {
    long long f = 0, z = -1;
    a = "";
    b = "";
    c = "";
    d = "";
    for (long long j = 0; j < v[i].length(); j++) {
      if (v[i][j] == 'a' || v[i][j] == 'e' || v[i][j] == 'i' ||
          v[i][j] == 'o' || v[i][j] == 'u')
        f++;
      if (f == k) {
        z = j;
        break;
      }
    }
    if (z == -1) {
      cout << "NO";
      return 0;
    }
    for (long long j = 0; j <= z; j++) a += v[i][j];
    f = 0;
    z = -1;
    for (long long j = 0; j < v[i + 1].length(); j++) {
      if (v[i + 1][j] == 'a' || v[i + 1][j] == 'e' || v[i + 1][j] == 'i' ||
          v[i + 1][j] == 'o' || v[i + 1][j] == 'u')
        f++;
      if (f == k) {
        z = j;
        break;
      }
    }
    if (z == -1) {
      cout << "NO";
      return 0;
    }
    for (long long j = 0; j <= z; j++) b += v[i + 1][j];
    f = 0;
    z = -1;
    for (long long j = 0; j < v[i + 2].length(); j++) {
      if (v[i + 2][j] == 'a' || v[i + 2][j] == 'e' || v[i + 2][j] == 'i' ||
          v[i + 2][j] == 'o' || v[i + 2][j] == 'u')
        f++;
      if (f == k) {
        z = j;
        break;
      }
    }
    if (z == -1) {
      cout << "NO";
      return 0;
    }
    for (long long j = 0; j <= z; j++) c += v[i + 2][j];
    f = 0;
    z = -1;
    for (long long j = 0; j < v[i + 3].length(); j++) {
      if (v[i + 3][j] == 'a' || v[i + 3][j] == 'e' || v[i + 3][j] == 'i' ||
          v[i + 3][j] == 'o' || v[i + 3][j] == 'u')
        f++;
      if (f == k) {
        z = j;
        break;
      }
    }
    if (z == -1) {
      cout << "NO";
      return 0;
    }
    for (long long j = 0; j <= z; j++) d += v[i + 3][j];
    if (a == b && b == c && c == d)
      ans.push_back("pass");
    else if (a == b && c == d)
      ans.push_back("aabb");
    else if (a == c && b == d)
      ans.push_back("abab");
    else if (a == d && b == c)
      ans.push_back("abba");
    else
      ans.push_back("NO");
  }
  long long check = 0;
  set<string> ss;
  for (long long i = 0; i < ans.size(); i++) {
    if (ans[i] == "NO") {
      cout << "NO";
      return 0;
    }
    if (ans[i] != "pass") {
      check = 1;
      ss.insert(ans[i]);
    }
  }
  if (check == 0) {
    cout << "aaaa";
    return 0;
  }
  if (ss.size() > 1)
    cout << "NO";
  else
    cout << (*ss.begin());
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int TESTS = 1;
  while (TESTS--) TLE_TERROR();
  return 0;
}
