#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long MAX = 3e5 + 10;
const long long inf = 1e18 + 7;
long long k;
bool es_vocal(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
bool solve(string &s) {
  long long cont = k;
  for (long long i = (long long)s.size() - 1; i >= 0; i--) {
    if (es_vocal(s[i])) cont--;
    if (!cont) {
      s = s.substr(i, (long long)s.size() - i);
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  long long go = 0;
  string a, b, c, d;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (!solve(a) || !solve(b) || !solve(c) || !solve(d)) {
      cout << "NO\n";
      return 0;
    }
    if (a == b && c == d) {
      if (b != c) {
        if (go == 0)
          go++;
        else if (go != 1) {
          cout << "NO\n";
          return 0;
        }
      }
    } else if (a == c && b == d) {
      if (!go)
        go = 2;
      else if (go != 2) {
        cout << "NO\n";
        return 0;
      }
    } else if (a == d && b == c) {
      if (!go)
        go = 3;
      else if (go != 3) {
        cout << "NO\n";
        return 0;
      }
    } else {
      cout << "NO\n";
      return 0;
    }
  }
  if (go == 0)
    cout << "aaaa\n";
  else if (go == 1)
    cout << "aabb\n";
  else if (go == 2)
    cout << "abab\n";
  else
    cout << "abba\n";
  return 0;
}
