#include <bits/stdc++.h>
using namespace std;
int mer(vector<int> &v) {
  int last = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] != 0) {
      if (v[i] == -1)
        return -1;
      else if (last == 0)
        last = v[i];
      else if (last != v[i])
        return -1;
    }
  }
  return last;
}
int c(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ? 1 : 0);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> res;
  for (int i = 0; i < n; i++) {
    string s[4], t[4];
    for (int j = 0; j < 4; j++) {
      cin >> s[j];
      t[j] = "1";
      int cnt = 0;
      for (int l = s[j].size() - 1; l >= 0; l--) {
        cnt += c(s[j][l]);
        if (cnt == k) {
          t[j] = s[j].substr(l);
          break;
        }
      }
    }
    if (t[0] == "1" || t[1] == "1" || t[2] == "1" || t[3] == "1")
      res.push_back(-1);
    else if (t[0] == t[1] && t[1] == t[2] && t[2] == t[3])
      res.push_back(0);
    else if (t[0] == t[1] && t[2] == t[3])
      res.push_back(1);
    else if (t[0] == t[2] && t[1] == t[3])
      res.push_back(2);
    else if (t[0] == t[3] && t[1] == t[2])
      res.push_back(3);
    else
      res.push_back(-1);
  }
  int resp = mer(res);
  if (resp == -1)
    cout << "NO";
  else if (resp == 0)
    cout << "aaaa";
  else if (resp == 1)
    cout << "aabb";
  else if (resp == 2)
    cout << "abab";
  else if (resp == 3)
    cout << "abba";
  return 0;
}
