#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17 + 7;
const long long MOD = 1e7 + 9;
vector<string> vow{"aaaa", "aabb", "abab", "abba"};
string vowel = "aeiou";
string suf(string s, long long k) {
  long long cnt = 0;
  for (long long i = s.length() - 1; i >= 0; i--) {
    if (find(vowel.begin(), vowel.end(), s[i]) != vowel.end()) cnt++;
    if (cnt == k) {
      return s.substr(i, s.length() - i);
    }
  }
  return "";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, k;
  cin >> n >> k;
  string inp[4 * n];
  for (long long i = 0; i < 4 * n; i++) {
    string s;
    cin >> s;
    s = suf(s, k);
    if (s == "") {
      cout << "NO"
           << "\n";
      return 0;
    }
    inp[i] = s;
  }
  for (long long p = 0; p < 4; p++) {
    bool flag = true;
    for (long long i = 0; i < 4 * n; i += 4) {
      for (long long j = 0; j < 4; j++) {
        for (long long x = j + 1; x < 4; x++) {
          if (vow[p][j] == vow[p][x] && inp[i + j] != inp[x + i]) flag = false;
        }
      }
    }
    if (flag) {
      cout << vow[p] << "\n";
      return 0;
    }
  }
  cout << "NO"
       << "\n";
  return 0;
}
