#include <bits/stdc++.h>
using namespace std;
string s[4 * 3000];
string t, size;
int n, k;
string ans;
string res;
string answer[4 * 3000];
void findThe() {
  int size = 0;
  for (int i = 0; i <= 4 * n; i += 4) {
    bool ok1 = false;
    bool ok2 = false;
    bool ok3 = false;
    if (s[i + 1] == s[i + 2] && s[i + 3] == s[i + 4]) {
      ans = "aabb";
      ok1 = true;
    }
    if (s[i + 1] == s[i + 3] && s[i + 2] == s[i + 4]) {
      ans = "abab";
      ok2 = true;
    }
    if (s[i + 1] == s[i + 4] && s[i + 2] == s[i + 3]) {
      ans = "abba";
      ok3 = true;
    }
    if (ok1 && ok2 && ok3) {
      ans = "aaaa";
    }
    if (!ok1 && !ok2 && !ok3) {
      cout << "NO";
      exit(0);
    }
    answer[size++] = ans;
  }
  for (int i = 0; i < size; i++) {
    if (answer[i] == "aaaa") continue;
    for (int j = i; j < size; j++) {
      if (answer[i] != answer[j] && answer[j] != "aaaa") {
        cout << "NO";
        exit(0);
      }
    }
  }
  for (int i = 0; i < size; i++) {
    if (answer[i] != "aaaa") {
      cout << answer[i];
      exit(0);
    }
  }
  cout << answer[0];
  exit(0);
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= 4 * n; i++) {
    cin >> t;
    int cnt = 0;
    bool ok = false;
    for (int j = t.length() - 1; j >= 0; j--) {
      if (t[j] == 'a' || t[j] == 'e' || t[j] == 'i' || t[j] == 'o' ||
          t[j] == 'u') {
        cnt++;
      }
      s[i] += t[j];
      if (cnt == k) {
        ok = true;
        break;
      }
    }
    if (!ok) {
      cout << "NO";
      return 0;
    }
  }
  findThe();
  return 0;
}
