#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30, N = 1002;
int ax[] = {0, 1, -1, 0, 0};
int ay[] = {0, 0, 0, -1, 1};
string a[10002];
bool rifma(int first, int second, int k) {
  int n = a[first].size() - 1;
  int m = a[second].size() - 1;
  while (true) {
    if (a[first][n] != a[second][m]) return false;
    if (a[first][n] == 'a' || a[first][n] == 'e' || a[first][n] == 'i' ||
        a[first][n] == 'o' || a[first][n] == 'u') {
      k--;
    }
    if (k == 0) {
      return true;
    }
    n--;
    m--;
    if (n == -1 || m == -1) {
      return false;
    }
  }
  return true;
}
void upd(int z, int &now) {
  if (now == 0) {
    now = z;
    return;
  }
  if (now == -1) {
    now = z;
    return;
  }
  if (z == -1) {
    return;
  }
  if (now != z) {
    cout << "NO";
    exit(0);
  }
  if (now == z) return;
}
int main() {
  int i, j, k, n;
  cin >> n >> k;
  n *= 4;
  for (i = 1; i <= n; i++) cin >> a[i];
  int now = 0;
  for (i = 1; i <= n; i += 4) {
    if (rifma(i, i + 1, k) && rifma(i + 2, i + 3, k) && rifma(i, i + 3, k)) {
      upd(-1, now);
      continue;
    }
    if (rifma(i, i + 1, k) && rifma(i + 2, i + 3, k)) {
      upd(1, now);
      continue;
    }
    if (rifma(i, i + 2, k) && rifma(i + 1, i + 3, k)) {
      upd(2, now);
      continue;
    }
    if (rifma(i, i + 3, k) && rifma(i + 1, i + 2, k)) {
      upd(3, now);
      continue;
    }
    cout << "NO";
    return 0;
  }
  if (now == 1) cout << "aabb";
  if (now == 2) cout << "abab";
  if (now == 3) cout << "abba";
  if (now == -1) cout << "aaaa";
  return 0;
}
