#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
using namespace std;
const string IN_NAME = "input.txt";
const string OUT_NAME = "output.txt";
template <class T>
T abs(T &x) {
  return ((x) >= 0) ? (x) : (-(x));
}
template <class T>
T sqr(T &x) {
  return (x) * (x);
}
template <class T>
T min(T &a, T &b) {
  return ((a) < (b)) ? (a) : (b);
}
template <class T>
T max(T &a, T &b) {
  return ((a) > (b)) ? (a) : (b);
}
int n, k;
string s[4];
string sub[4];
const int aabb = 0, abab = 1, abba = 2, aaaa = 3;
bool answer[4];
bool isVowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
bool getVowels(int index) {
  int i = ((int)((s[index]).size())) - 1;
  int j = 0;
  while (i >= 0) {
    if (isVowel(s[index][i])) j++;
    if (j == k) {
      sub[index] = s[index].substr(i, ((int)((s[index]).size())) - i + 1);
      return true;
    }
    i--;
  }
  return false;
}
bool equal(int ind1, int ind2) { return sub[ind1] == sub[ind2]; }
void getAns() {
  for (int i = 0; i < 4; i++)
    if (!getVowels(i)) {
      for (int j = 0; j < 4; j++) answer[j] = false;
      return;
    }
  if (equal(0, 1) && equal(1, 2) && equal(2, 3) && equal(3, 0))
    ;
  else
    answer[aaaa] = false;
  if (equal(0, 1) && equal(2, 3))
    ;
  else
    answer[aabb] = false;
  if (equal(0, 2) && equal(1, 3))
    ;
  else
    answer[abab] = false;
  if (equal(0, 3) && equal(1, 2))
    ;
  else
    answer[abba] = false;
}
int main() {
  for (int i = 0; i < 4; i++) answer[i] = true;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> s[j];
    }
    getAns();
  }
  if (answer[aaaa]) {
    cout << "aaaa";
    return 0;
  }
  int cnt = 0;
  for (int i = 0; i <= 2; i++)
    if (answer[i]) cnt++;
  if (cnt != 1) {
    cout << "NO";
    return 0;
  }
  if (answer[aabb]) {
    cout << "aabb";
    return 0;
  }
  if (answer[abba]) {
    cout << "abba";
    return 0;
  }
  if (answer[abab]) {
    cout << "abab";
    return 0;
  }
}
