#include <bits/stdc++.h>
using namespace std;
string a[10005];
string p[4] = {"aaaa", "aabb", "abab", "abba"};
int main() {
  int n, k, flag = 0;
  cin >> n >> k;
  n *= 4;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    string s;
    cin >> s;
    a[i] = "";
    while (cnt < k && s.size()) {
      char x = s[s.size() - 1];
      s.erase(s.size() - 1);
      a[i] += x;
      if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') cnt++;
    }
    if (cnt < k) flag = 1;
  }
  if (!flag) {
    for (int i = 0; i < 4; i++) {
      int ok2 = 1;
      for (int j = 0; j < n; j += 4) {
        int ok1 = 1;
        for (int x = 0; x < 4 && ok1; x++) {
          for (int y = x + 1; y < 4 && ok1; y++) {
            if (p[i][x] == p[i][y] && a[j + x] != a[j + y]) ok1 = 0;
            if (!ok1) {
              ok2 = 0;
              break;
            }
          }
        }
      }
      if (ok2) {
        cout << p[i];
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
