#include <bits/stdc++.h>
using namespace std;
int n, k;
bool x = 1, y = x, z = y;
string get(string const s) {
  int c = 0, i = s.length();
  while (i >= 0 && c < k) {
    --i;
    c += (string("aeiou").find(s[i]) < 5);
  }
  return c == k ? s.substr(i) : "###";
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    string a, b, c, d;
    cin >> a >> b >> c >> d;
    a = get(a), b = get(b);
    c = get(c), d = get(d);
    x &= (a == b && c == d);
    y &= (a == c && b == d);
    z &= (a == d && b == c);
    if (a[0] == '#' || b[0] == '#' || c[0] == '#' || d[0] == '#') {
      x = y = z = 0;
    }
  }
  if (x && y && z) {
    cout << "aaaa";
  } else if (x) {
    cout << "aabb";
  } else if (y) {
    cout << "abab";
  } else if (z) {
    cout << "abba";
  } else {
    cout << "NO";
  }
  return 0;
}
