#include <bits/stdc++.h>
using namespace std;
set<char> V = {'a', 'e', 'i', 'o', 'u'};
bool match(string& a, string& b, int k) {
  int i = a.size() - 1, j = b.size() - 1;
  while (i >= 0 && j >= 0) {
    if (a[i] != b[j]) return 0;
    if (V.count(a[i]) && --k == 0) return 1;
    i--, j--;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  bitset<4> b(0);
  while (n-- && b.count() != 4) {
    string a[4];
    for (int i = 0; i < 4; i++) cin >> a[i];
    if (match(a[0], a[1], k) && match(a[0], a[2], k) && match(a[0], a[3], k))
      continue;
    b[0] = 1;
    if (match(a[0], a[1], k)) {
      if (!b[1] && !match(a[2], a[3], k)) b[1] = 1;
      b[2] = b[3] = 1;
    } else if (match(a[0], a[2], k)) {
      if (!b[2] && !match(a[1], a[3], k)) b[2] = 1;
      b[1] = b[3] = 1;
    } else if (match(a[0], a[3], k)) {
      if (!b[3] && !match(a[1], a[2], k)) b[3] = 1;
      b[2] = b[1] = 1;
    } else
      b[1] = b[2] = b[3] = 1;
  }
  if (!b[0])
    cout << "aaaa\n";
  else if (!b[1])
    cout << "aabb\n";
  else if (!b[2])
    cout << "abab\n";
  else if (!b[3])
    cout << "abba\n";
  else
    cout << "NO\n";
}
