#include <bits/stdc++.h>
using namespace std;
vector<int> T;
int n, k;
long long p = 31;
bool glas(char c) {
  if (c == 'a' || c == 'o' || c == 'u' || c == 'e' || c == 'i')
    return true;
  else
    return false;
}
int type_of(string &s1, string &s2, string &s3, string &s4) {
  long long hash1 = 0, hash2 = 0, hash3 = 0, hash4 = 0;
  long long cur_p = 1;
  int dt = k;
  for (int i = int(s1.size()) - 1; i >= 0, dt > 0; i--) {
    if (glas(s1[i])) dt--;
    hash1 += (s1[i] - 'a' + 1) * cur_p;
    cur_p *= p;
  }
  if (dt > 0) return 0;
  cur_p = 1;
  dt = k;
  for (int i = int(s2.size()) - 1; i >= 0, dt > 0; i--) {
    if (glas(s2[i])) dt--;
    hash2 += (s2[i] - 'a' + 1) * cur_p;
    cur_p *= p;
  }
  if (dt > 0) return 0;
  cur_p = 1;
  dt = k;
  for (int i = int(s3.size()) - 1; i >= 0, dt > 0; i--) {
    if (glas(s3[i])) dt--;
    hash3 += (s3[i] - 'a' + 1) * cur_p;
    cur_p *= p;
  }
  if (dt > 0) return 0;
  cur_p = 1;
  dt = k;
  for (int i = int(s4.size()) - 1; i >= 0, dt > 0; i--) {
    if (glas(s4[i])) dt--;
    hash4 += (s4[i] - 'a' + 1) * cur_p;
    cur_p *= p;
  }
  if (dt > 0) return 0;
  if (hash1 == hash2 && hash2 == hash3 && hash3 == hash4 && hash4 == hash1)
    return 4;
  if (hash1 == hash2 && hash3 == hash4) return 3;
  if (hash1 == hash3 && hash2 == hash4) return 2;
  if (hash1 == hash4 && hash2 == hash3) return 1;
  return 0;
}
int main() {
  cin >> n >> k;
  string s1, s2, s3, s4;
  for (int i = 0; i < n; i++) {
    cin >> s1 >> s2 >> s3 >> s4;
    T.push_back(type_of(s1, s2, s3, s4));
    if (T.back() == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  int frst = -1;
  for (int i = 0; i < T.size(); i++) {
    if (T[i] == 4) continue;
    if (frst == -1) {
      frst = T[i];
      continue;
    }
    if (T[i] != frst) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (frst == -1) cout << "aaaa" << endl;
  if (frst == 3) cout << "aabb" << endl;
  if (frst == 2) cout << "abab" << endl;
  if (frst == 1) cout << "abba" << endl;
  return 0;
}
