#include <bits/stdc++.h>
using namespace std;
int n, k;
string line[4];
bool rhymes = true;
vector<string> scheme;
string s = "aaaa";
bool isVowel(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
string getSubstr(string str) {
  int count = 0;
  string ans = "!";
  int curr = str.size() - 1;
  while (count < k && curr >= 0) count += isVowel(str[curr--]) ? 1 : 0;
  if (curr < 0 && count != k) rhymes = false;
  return (ans = str.substr(curr + 1));
}
void getScheme() {
  string temp[4];
  for (int i = 0; i < 4; i++) {
    temp[i] = getSubstr(line[i]);
  }
  if (temp[0] == temp[1]) {
    if (temp[2] == temp[3]) {
      if (temp[1] == temp[2])
        scheme.push_back("aaaa");
      else
        scheme.push_back("aabb");
      return;
    } else
      rhymes = false;
  } else {
    if (temp[1] == temp[3] && temp[0] == temp[2])
      scheme.push_back("abab");
    else if (temp[1] == temp[2] && temp[0] == temp[3])
      scheme.push_back("abba");
    else
      rhymes = false;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) cin >> line[j];
    getScheme();
  }
  for (int i = 0; i < scheme.size(); i++) {
    if (scheme[i] != "aaaa") {
      if (s == "aaaa")
        s = scheme[i];
      else
        rhymes = (rhymes && (s == scheme[i]));
    }
  }
  rhymes ? cout << s << endl : cout << "NO\n";
}
