#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<string> ss;
string ans = "aaaa";
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    string tmp;
    ss.clear();
    for (int j = 0; j < 4; j++) {
      string s;
      cin >> s;
      int cnt = 0, p = s.length() - 1;
      while (p >= 0) {
        if (strchr("aeiou", s[p]) != NULL) cnt++;
        if (cnt == k) {
          ss.push_back(s.substr(p));
          break;
        }
        p--;
      }
    }
    if (ss.size() < 4)
      tmp = "NO";
    else if (ss[0] == ss[1] && ss[1] == ss[2] && ss[2] == ss[3])
      tmp = "aaaa";
    else if (ss[0] == ss[1] && ss[2] == ss[3])
      tmp = "aabb";
    else if (ss[0] == ss[2] && ss[1] == ss[3])
      tmp = "abab";
    else if (ss[0] == ss[3] && ss[1] == ss[2])
      tmp = "abba";
    else
      tmp = "NO";
    if (ans == "aaaa")
      ans = tmp;
    else if (tmp == "aaaa" || ans == tmp)
      ;
    else
      ans = "NO";
  }
  cout << ans << endl;
}
