#include <bits/stdc++.h>
using namespace std;
struct LINE {
  string s;
} L[2500 * 4 + 2];
bool ok(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  return false;
}
int getpos(string s, int k, int& len) {
  int l = s.size();
  int ct = 0;
  for (int i = l - 1; i >= 0; i--) {
    if (ok(s[i])) {
      ct++;
    }
    if (ct == k) {
      len = (l - i);
      return i;
    }
  }
  return -1;
}
string ans[4] = {"aabb", "abab", "abba", "aaaa"};
int main() {
  int n, k;
  string s1, s2;
  while (cin >> n >> k) {
    bool OK = true;
    string tem;
    for (int i = 0; i < 4 * n; i++) {
      cin >> tem;
      int len = 0;
      int pos = getpos(tem, k, len);
      if (pos == -1) {
        OK = false;
      } else {
        L[i].s = tem.substr(pos, len);
      }
    }
    if (!OK) {
      cout << "NO\n";
      continue;
    }
    int res = -1;
    bool allcur = false;
    bool an = true;
    for (int i = 0; i < n; i++) {
      bool all = true;
      for (int j = 0; j < 3; j++) {
        if (L[i * 4 + j].s != L[i * 4 + j + 1].s) {
          all = false;
        }
      }
      if (all)
        allcur = true;
      else {
        int cur = -2;
        if (L[i * 4].s == L[i * 4 + 1].s && L[i * 4 + 2].s == L[i * 4 + 3].s)
          cur = 0;
        else if (L[i * 4].s == L[i * 4 + 2].s &&
                 L[i * 4 + 1].s == L[i * 4 + 3].s)
          cur = 1;
        else if (L[i * 4].s == L[i * 4 + 3].s &&
                 L[i * 4 + 1].s == L[i * 4 + 2].s)
          cur = 2;
        if (res == -1 && cur != -2)
          res = cur;
        else if (res != cur) {
          an = false;
          break;
        }
      }
    }
    if (!an)
      cout << "NO\n";
    else {
      if (res == -1 && allcur) {
        cout << ans[3] << endl;
      } else if (res == -1) {
        cout << "NO\n";
      } else
        cout << ans[res] << endl;
    }
  }
  return 0;
}
