#include <bits/stdc++.h>
using namespace std;
int n, k;
int rhymes[2550];
string arr[4];
int vowel(char a) {
  return (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u');
}
int rhyme(string a, string b) {
  int cnt = 0;
  int i;
  for ((i) = 0; (i) < (int)(((int)(a).size())); (i)++)
    if (vowel(a[i])) cnt++;
  if (cnt < k) return 0;
  cnt = 0;
  for ((i) = 0; (i) < (int)(((int)(b).size())); (i)++)
    if (vowel(b[i])) cnt++;
  if (cnt < k) return 0;
  int aa = ((int)(a).size()) - 1;
  cnt = 0;
  while (1) {
    if (vowel(a[aa])) cnt++;
    if (cnt == k) break;
    aa--;
  }
  int bb = ((int)(b).size()) - 1;
  cnt = 0;
  while (1) {
    if (vowel(b[bb])) cnt++;
    if (cnt == k) break;
    bb--;
  }
  return a.substr(aa, ((int)(a).size()) - aa) ==
         b.substr(bb, ((int)(b).size()) - bb);
}
int check[4][4];
int main() {
  memset(rhymes, -1, sizeof(rhymes));
  int i, j, z;
  cin >> n >> k;
  for ((i) = 0; (i) < (int)(n); (i)++) {
    for ((j) = 0; (j) < (int)(4); (j)++) cin >> arr[j];
    for ((j) = 0; (j) < (int)(4); (j)++)
      for ((z) = 0; (z) < (int)(4); (z)++) {
        if (rhyme(arr[j], arr[z]))
          check[j][z] = 1;
        else
          check[j][z] = 0;
      }
    if (check[0][1] && check[2][3]) rhymes[i] = 0;
    if (check[0][2] && check[1][3]) rhymes[i] = 1;
    if (check[0][3] && check[1][2]) rhymes[i] = 2;
    if (check[0][1] && check[1][2] && check[2][3]) rhymes[i] = 3;
  }
  int last = 1;
  for ((i) = 0; (i) < (int)(n); (i)++) {
    if (rhymes[i] != 3) last = 0;
  }
  if (last) {
    cout << "aaaa" << endl;
    cin.get();
    cin.get();
    return 0;
  }
  for ((i) = 0; (i) < (int)(3); (i)++) {
    int works = 1;
    for ((j) = 0; (j) < (int)(n); (j)++) {
      if (rhymes[j] != 3 && rhymes[j] != i) works = 0;
    }
    if (works) {
      if (i == 0) {
        cout << "aabb" << endl;
        cin.get();
        cin.get();
        return 0;
      }
      if (i == 1) {
        cout << "abab" << endl;
        cin.get();
        cin.get();
        return 0;
      }
      if (i == 2) {
        cout << "abba" << endl;
        cin.get();
        cin.get();
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  cin.get();
  cin.get();
  return 0;
}
