#include <bits/stdc++.h>
char p[10000];
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  char tr[2];
  gets(tr);
  string type = "aaaa";
  for (int i = 0; i < n; i++) {
    gets(p);
    string suf1, suf2, suf3, suf4, ptype = "qq";
    int u = 0, r = strlen(p) - 1;
    while (u < k) {
      if (p[r] == 'a' || p[r] == 'e' || p[r] == 'i' || p[r] == 'o' ||
          p[r] == 'u')
        u++;
      suf1 += p[r];
      r--;
      if (r < 0) break;
    }
    if (u != k) {
      cout << "NO";
      return 0;
    }
    gets(p);
    u = 0, r = strlen(p) - 1;
    while (u < k) {
      if (p[r] == 'a' || p[r] == 'e' || p[r] == 'i' || p[r] == 'o' ||
          p[r] == 'u')
        u++;
      suf2 += p[r];
      r--;
      if (r < 0) break;
    }
    if (u != k) {
      cout << "NO";
      return 0;
    }
    gets(p);
    u = 0, r = strlen(p) - 1;
    while (u < k) {
      if (p[r] == 'a' || p[r] == 'e' || p[r] == 'i' || p[r] == 'o' ||
          p[r] == 'u')
        u++;
      suf3 += p[r];
      r--;
      if (r < 0) break;
    }
    if (u != k) {
      cout << "NO";
      return 0;
    }
    gets(p);
    u = 0, r = strlen(p) - 1;
    while (u < k) {
      if (p[r] == 'a' || p[r] == 'e' || p[r] == 'i' || p[r] == 'o' ||
          p[r] == 'u')
        u++;
      suf4 += p[r];
      r--;
      if (r < 0) break;
    }
    if (u != k) {
      cout << "NO";
      return 0;
    }
    if (suf1 == suf2 && suf2 == suf3 && suf3 == suf4) continue;
    if (suf1 == suf2 && suf1 != suf3 && suf3 == suf4) ptype = "aabb";
    if (suf1 == suf3 && suf1 != suf2 && suf2 == suf4) ptype = "abab";
    if (suf1 == suf4 && suf2 == suf3 && suf1 != suf3) ptype = "abba";
    if (ptype == "qq") {
      cout << "NO";
      return 0;
    }
    if (type != ptype) {
      if (type == "aaaa")
        type = ptype;
      else {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << type;
  return 0;
}
