#include <bits/stdc++.h>
using namespace std;
int n, k;
string ans = "";
vector<string> v;
void die() {
  cout << "NO" << endl;
  exit(0);
}
string func(string s) {
  int cnt = 0;
  for (int i = (int)s.size() - 1; i >= 0; i--)
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
        s[i] == 'u') {
      ++cnt;
      if (cnt == k) return s.substr(i);
    }
  die();
  return "ERROR";
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    v.clear();
    for (int j = 0; j < 4; j++) {
      string s;
      cin >> s;
      string x = func(s);
      if (x == "ERROR") die();
      v.push_back(x);
    }
    if (v[0] == v[1] && v[0] == v[2] && v[0] == v[3] && v[1] == v[2] &&
        v[1] == v[3] && v[2] == v[3]) {
      if (ans == "") ans = "aaaa";
    } else if (v[0] == v[1] && v[2] == v[3]) {
      if (ans != "" && ans != "aaaa" && ans != "aabb") die();
      ans = "aabb";
    } else if (v[0] == v[2] && v[1] == v[3]) {
      if (ans != "" && ans != "aaaa" && ans != "abab") die();
      ans = "abab";
    } else if (v[0] == v[3] && v[1] == v[2]) {
      if (ans != "" && ans != "aaaa" && ans != "abba") die();
      ans = "abba";
    } else
      die();
  }
  cout << ans << endl;
  return 0;
}
