#include <bits/stdc++.h>
using namespace std;
bool shorten(string &s, int k) {
  int i = s.size() - 1;
  for (; i >= 0; i--) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
        s[i] == 'u') {
      k--;
      if (k == 0) break;
    }
  }
  if (k) return 0;
  s = s.substr(i);
  return 1;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<string> s(4 * n);
  for (int i = 0; i < 4 * n; i++) cin >> s[i];
  vector<int> v(4);
  vector<int> r(n, -1);
  vector<vector<int> > rh = {
      {0, 0, 0, 0}, {0, 0, 1, 1}, {0, 1, 1, 0}, {0, 1, 0, 1}};
  vector<string> rhy = {"aaaa\n", "aabb\n", "abba\n", "abab\n"};
  for (int j = 0; j < n; j++) {
    int bi = -1;
    for (int i = 0; i < 4; i++) {
      if (!shorten(s[i + 4 * j], k)) {
        cout << "NO\n";
        return 0;
      }
      if (s[i + 4 * j] == s[4 * j])
        v[i] = 0;
      else if (bi == -1) {
        bi = i;
        v[i] = 1;
      } else if (s[i + 4 * j] == s[bi + 4 * j])
        v[i] = 1;
      else {
        cout << "NO\n";
        return 0;
      }
    }
    for (int i = 0; i < 4; i++) {
      if (v == rh[i]) r[j] = i;
    }
    if (r[j] == -1) {
      cout << "NO\n";
      return 0;
    }
  }
  int rx = 0;
  for (int i = 0; i < n; i++) {
    if (r[i] != rx) {
      if (rx == 0) {
        rx = r[i];
      } else if (r[i] != 0) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << rhy[rx];
}
