#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, m, n, t, t1, s, e[11];
string q, p, r, a[11111], b[11111], c[11111], d[11111];
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> p;
    l = p.size() - 1;
    t = k;
    while (t > 0 && l >= 0) {
      if (p[l] == 'a' || p[l] == 'e' || p[l] == 'i' || p[l] == 'o' ||
          p[l] == 'u')
        t--;
      l--;
    }
    if (t == 0) {
      for (j = l + 1; j < p.size(); j++) a[i] += p[j];
    } else {
      cout << "NO";
      return 0;
    }
    cin >> p;
    l = p.size() - 1;
    t = k;
    while (t > 0 && l >= 0) {
      if (p[l] == 'a' || p[l] == 'e' || p[l] == 'i' || p[l] == 'o' ||
          p[l] == 'u')
        t--;
      l--;
    }
    if (t == 0) {
      for (j = l + 1; j < p.size(); j++) b[i] += p[j];
    } else {
      cout << "NO";
      return 0;
    }
    cin >> p;
    l = p.size() - 1;
    t = k;
    while (t > 0 && l >= 0) {
      if (p[l] == 'a' || p[l] == 'e' || p[l] == 'i' || p[l] == 'o' ||
          p[l] == 'u')
        t--;
      l--;
    }
    if (t == 0) {
      for (j = l + 1; j < p.size(); j++) c[i] += p[j];
    } else {
      cout << "NO";
      return 0;
    }
    cin >> p;
    l = p.size() - 1;
    t = k;
    while (t > 0 && l >= 0) {
      if (p[l] == 'a' || p[l] == 'e' || p[l] == 'i' || p[l] == 'o' ||
          p[l] == 'u')
        t--;
      l--;
    }
    if (t == 0) {
      for (j = l + 1; j < p.size(); j++) d[i] += p[j];
    } else {
      cout << "NO";
      return 0;
    }
  }
  t = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == b[i] && a[i] == c[i] && a[i] == d[i]) t++;
  }
  if (t == n) {
    cout << "aaaa";
    return 0;
  }
  t = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == b[i] && c[i] == d[i]) t++;
  }
  if (t == n) {
    cout << "aabb";
    return 0;
  }
  t = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == c[i] && b[i] == d[i]) t++;
  }
  if (t == n) {
    cout << "abab";
    return 0;
  }
  t = 0;
  for (i = 0; i < n; i++) {
    if (c[i] == b[i] && a[i] == d[i]) t++;
  }
  if (t == n) {
    cout << "abba";
    return 0;
  }
  cout << "NO";
}
