#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
template <class T1, class T2, class T3>
void printTuple(tuple<T1, T2, T3> t) {
  cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\n';
}
template <class T1, class T2>
void printPair(pair<T1, T2> p) {
  cout << p.first << " " << p.second << '\n';
}
template <class T>
void printArray(vector<T> arr) {
  for (int i = 0; i < int((arr).size()); i++) {
    cout << arr[i] << " ";
  }
  cout << '\n';
}
bool isVowel(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  bool possible = true;
  vector<vector<string>> quadrains(n, vector<string>(4));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) cin >> quadrains[i][j];
  }
  vector<string> q_scheme(n);
  vector<char> vowels{'a', 'e', 'i', 'o', 'u'};
  for (int i = 0; i < n && possible; i++) {
    vector<string> scheme(4);
    for (int j = 0; j < 4 && possible; j++) {
      int count_vowels = k, ptr = -1;
      for (int z = int((quadrains[i][j]).size()) - 1;
           z >= 0 && count_vowels > 0; z--) {
        if (isVowel(quadrains[i][j][z])) {
          count_vowels--;
          ptr = z;
        }
      }
      if (count_vowels > 0)
        possible = false;
      else
        scheme[j] = quadrains[i][j].substr(
            ptr, int((quadrains[i][j]).size()) - ptr + 1);
    }
    bool different = false;
    for (int j = 1; j < 4 && !different; j++) {
      if (scheme[j] != scheme[j - 1]) different = true;
    }
    if (!different)
      q_scheme[i] = "";
    else {
      if (scheme[0] == scheme[1] && scheme[2] == scheme[3])
        q_scheme[i] = "aabb";
      else if (scheme[1] == scheme[3] && scheme[0] == scheme[2])
        q_scheme[i] = "abab";
      else if (scheme[0] == scheme[3] && scheme[1] == scheme[2])
        q_scheme[i] = "abba";
      else
        possible = false;
    }
  }
  string common_scheme = "";
  for (int i = 0; i < n && possible; i++) {
    if (q_scheme[i] == "") continue;
    if (common_scheme == "")
      common_scheme = q_scheme[i];
    else if (common_scheme != q_scheme[i])
      possible = false;
  }
  if (possible)
    cout << (common_scheme == "" ? "aaaa" : common_scheme) << '\n';
  else
    cout << "NO" << '\n';
}
