#include <bits/stdc++.h>
using namespace std;
const string tp[4] = {"aaaa", "aabb", "abab", "abba"};
int n;
int m, k;
string w[10000];
int main() {
  cin >> n >> k;
  n *= 4;
  int bad = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    w[i] = "";
    int l = 0;
    while (l < k && s.size()) {
      char c = s[s.size() - 1];
      w[i] += c;
      s.erase(s.size() - 1);
      if (c == 'a' || c == 'i' || c == 'e' || c == 'o' || c == 'u') {
        l++;
      }
    }
    if (l < k) {
      bad = 1;
    }
  }
  if (!bad) {
    for (int t = 0; t < 4; t++) {
      int ok2 = 1;
      for (int i = 0; i < n; i += 4) {
        int ok = 1;
        for (int p = 0; p < 4 && ok; p++) {
          for (int q = p + 1; q < 4 && ok; q++) {
            if (tp[t][p] == tp[t][q] && w[i + p] != w[i + q]) {
              ok = 0;
            }
          }
        }
        if (!ok) {
          ok2 = 0;
          break;
        }
      }
      if (ok2) {
        cout << tp[t] << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
