#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream in("input.txt");
  int n, k;
  cin >> n >> k;
  string s[10005];
  int type[2501];
  for (int i = 0; i < 2500; i++) type[i] = 0;
  for (int i = 0; i < n * 4; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    int temp = 0;
    int index[] = {-1, -1, -1, -1};
    string tt[4];
    for (int l = 0; l < 4; l++) {
      for (int j = s[i * 4 + l].length() - 1; j >= 0; j--)
        if (s[i * 4 + l][j] == 'a' || s[i * 4 + l][j] == 'e' ||
            s[i * 4 + l][j] == 'i' || s[i * 4 + l][j] == 'o' ||
            s[i * 4 + l][j] == 'u') {
          temp++;
          if (temp == k) {
            index[l] = j;
            break;
          }
        }
      temp = 0;
    }
    for (int j = 0; j < 4; j++)
      if (index[j] != -1) {
        tt[j] = s[i * 4 + j].substr(index[j], s[i * 4 + j].length() - index[j]);
      } else {
        cout << "NO";
        return 0;
      }
    if (tt[0] == tt[1] && tt[2] == tt[3]) type[i] = 1;
    if (tt[0] == tt[2] && tt[1] == tt[3]) type[i] = 2;
    if (tt[0] == tt[3] && tt[1] == tt[2]) type[i] = 3;
    if ((tt[0] == tt[1]) && (tt[2] == tt[3]) && tt[1] == tt[2]) type[i] = 4;
  }
  if (type[0] == 0) {
    cout << "NO";
    return 0;
  }
  string zz[4];
  zz[0] = "aabb";
  zz[1] = "abab";
  zz[2] = "abba";
  zz[3] = "aaaa";
  string to_ans = zz[type[0] - 1];
  if (n == 1) {
    if (type[0] != 0) {
      cout << zz[type[0] - 1];
      return 0;
    } else {
      cout << "NO";
      return 0;
    }
  }
  bool b = false;
  int tmp_type = 4;
  for (int i = 0; i < n; i++) {
    if (type[i] == 4) continue;
    if (type[i] != 4 && !b) {
      b = true;
      tmp_type = type[i];
      to_ans = zz[type[i] - 1];
    }
    if (type[i] != 4 && b) {
      if (type[i] == tmp_type)
        continue;
      else {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << to_ans;
  return 0;
}
