#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(const int& lhs, const int& rhs) const { return lhs > rhs; }
};
struct comps {
  bool operator()(const string& lhs, const string& rhs) const {
    return lhs > rhs;
  }
};
bool f(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main() {
  int k, n;
  map<int, string> m[2505];
  int mm[2505];
  int g = 0;
  string aa = "aaaa";
  scanf("%d %d", &n, &k);
  for (int j = 0; j < n; j++) {
    for (int h = 1; h <= 4; h++) {
      string a;
      cin >> a;
      int kk = k;
      for (int i = a.length() - 1; i >= 0; i--) {
        if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' ||
            a[i] == 'u')
          kk--;
        if (!kk) {
          m[j][h] = a.substr(i, a.length());
          break;
        }
      }
      if (kk) {
        cout << "NO";
        return 0;
      }
    }
    if (m[j][1] == m[j][2] && m[j][2] == m[j][3] && m[j][3] == m[j][4])
      mm[j] = 0;
    else if (m[j][1] == m[j][2] && m[j][3] == m[j][4]) {
      mm[j] = 1;
      aa = "aabb";
    } else if (m[j][1] == m[j][3] && m[j][2] == m[j][4]) {
      mm[j] = 2;
      aa = "abab";
    } else if (m[j][1] == m[j][4] && m[j][2] == m[j][3]) {
      mm[j] = 3;
      aa = "abba";
    } else {
      cout << "NO";
      return 0;
    }
    if (mm[j] == 0) continue;
    if (g == 0) g = mm[j];
    if (mm[j] != g) {
      cout << "NO";
      return 0;
    }
  }
  cout << aa;
  return 0;
}
