#include <bits/stdc++.h>
using namespace std;
char s[10001];
string a[10001];
bool isvowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < 4 * n; ++i) {
    cin >> s;
    int len = strlen(s);
    int cnt = 0;
    for (int j = len - 1; j >= 0; j--) {
      if (isvowel(s[j])) cnt++;
      if (cnt == k) {
        a[i] = string(s + j);
        break;
      }
    }
    if (a[i].size() == 0) a[i] += i % 4 + '0';
  }
  bool aabb = true, abba = true, abab = true;
  for (int i = 0; i < 4 * n; i += 4) {
    aabb &= a[i] == a[i + 1] && a[i + 2] == a[i + 3];
    abba &= a[i] == a[i + 3] && a[i + 1] == a[i + 2];
    abab &= a[i] == a[i + 2] && a[i + 1] == a[i + 3];
  }
  if (aabb && abba && abab)
    cout << "aaaa" << endl;
  else if (aabb)
    cout << "aabb" << endl;
  else if (abba)
    cout << "abba" << endl;
  else if (abab)
    cout << "abab" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
