#include <bits/stdc++.h>
using namespace std;
int n, k;
bool get_term(string& s) {
  reverse(s.begin(), s.end());
  for (int i = 0, cnt = 0;; i++) {
    if (i == s.size()) return false;
    cnt += (strchr("aeiou", s[i]) != 0);
    if (cnt == k) {
      s = s.substr(0, i + 1);
      reverse(s.begin(), s.end());
      return true;
    }
  }
  return 1;
}
int posibil() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  bool ok = get_term(a);
  ok &= get_term(b);
  ok &= get_term(c);
  ok &= get_term(d);
  if (!ok) return 0;
  int nr = 0;
  if (a == b && c == d) nr |= 1;
  if (a == c && b == d) nr |= 2;
  if (a == d && b == c) nr |= 4;
  if (a == b && b == c && c == d) nr |= 8;
  return nr;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  int nr = 15;
  while (n--) nr &= posibil();
  if (nr & 8)
    cout << "aaaa\n";
  else if (nr & 1)
    cout << "aabb\n";
  else if (nr & 2)
    cout << "abab\n";
  else if (nr & 4)
    cout << "abba\n";
  else
    cout << "NO\n";
  return 0;
}
