#include <bits/stdc++.h>
using namespace std;
int n, k;
string s[10010];
bool rifm(string s, string t) {
  int j = s.length() - 1, l = t.length() - 1, kol = 0;
  while (s[j] == t[l]) {
    if (s[j] == 'a' || s[j] == 'e' || s[j] == 'i' || s[j] == 'o' || s[j] == 'u')
      kol++;
    if (kol == k) return true;
    j--;
    l--;
    if (j < 0 || l < 0) break;
  }
  return false;
}
string prov(int i) {
  if (rifm(s[i], s[i + 1]) && rifm(s[i + 2], s[i + 3]) &&
      rifm(s[i + 1], s[i + 2]))
    return "aaaa";
  if (rifm(s[i], s[i + 1]) && rifm(s[i + 2], s[i + 3])) return "aabb";
  if (rifm(s[i], s[i + 2]) && rifm(s[i + 1], s[i + 3])) return "abab";
  if (rifm(s[i], s[i + 3]) && rifm(s[i + 1], s[i + 2])) return "abba";
  return "NO";
}
string ans = "", tmp;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= 4 * n; i++) cin >> s[i];
  for (int i = 1; i <= 4 * n; i += 4) {
    tmp = prov(i);
    if (tmp == "NO") {
      cout << tmp;
      return 0;
    }
    if (ans == "") ans = tmp;
    if ((tmp != "aaaa" && ans != "aaaa") && ans != tmp) {
      cout << "NO";
      return 0;
    }
    if (tmp != "aaaa") ans = tmp;
  }
  cout << ans;
}
