#include <bits/stdc++.h>
using namespace std;
const int N = 3000;
int n, k;
struct quatrain {
  string s[5];
  string scheme;
} q[N];
bool vowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  return false;
}
bool rhyme(string x, string y) {
  string suffix_x, suffix_y;
  int i;
  int vowels;
  vowels = 0;
  for (i = x.size() - 1; i >= 0; i--) {
    if (vowel(x[i])) vowels++;
    if (vowels == k) {
      suffix_x = x.substr(i);
      break;
    }
  }
  vowels = 0;
  for (i = y.size() - 1; i >= 0; i--) {
    if (vowel(y[i])) vowels++;
    if (vowels == k) {
      suffix_y = y.substr(i);
      break;
    }
  }
  if (suffix_x.empty() || suffix_y.empty()) return false;
  if (suffix_x == suffix_y) return true;
  return false;
}
void get_scheme(int ind) {
  bool aabb, abab, abba;
  aabb = abab = abba = false;
  if (rhyme(q[ind].s[1], q[ind].s[2]) && rhyme(q[ind].s[3], q[ind].s[4]))
    aabb = true;
  if (rhyme(q[ind].s[1], q[ind].s[3]) && rhyme(q[ind].s[2], q[ind].s[4]))
    abab = true;
  if (rhyme(q[ind].s[1], q[ind].s[4]) && rhyme(q[ind].s[2], q[ind].s[3]))
    abba = true;
  int cnt_true = aabb + abab + abba;
  if (cnt_true > 1)
    q[ind].scheme = "aaaa";
  else if (cnt_true == 0)
    q[ind].scheme = "NO";
  else if (aabb)
    q[ind].scheme = "aabb";
  else if (abab)
    q[ind].scheme = "abab";
  else if (abba)
    q[ind].scheme = "abba";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> q[i].s[1] >> q[i].s[2] >> q[i].s[3] >> q[i].s[4];
  }
  for (i = 1; i <= n; i++) {
    get_scheme(i);
  }
  for (i = 1; i <= n; i++) {
    if (q[i].scheme == "NO") {
      cout << "NO" << endl;
      return 0;
    }
  }
  bool aabb, abab, abba;
  aabb = abab = abba = false;
  for (i = 1; i <= n; i++) {
    if (q[i].scheme == "aabb") aabb = true;
    if (q[i].scheme == "abab") abab = true;
    if (q[i].scheme == "abba") abba = true;
  }
  int cnt_true = aabb + abab + abba;
  if (cnt_true > 1)
    cout << "NO" << endl;
  else if (cnt_true == 0)
    cout << "aaaa" << endl;
  else if (aabb)
    cout << "aabb" << endl;
  else if (abab)
    cout << "abab" << endl;
  else if (abba)
    cout << "abba" << endl;
  return 0;
}
