#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int n, k;
char buf[10010], garbage[2];
string s[10010];
inline string check() {
  bool f = 1;
  for (int i = 0; i < n; i += 4) {
    for (int j = 0; j < 4; j++) {
      if (s[i] != s[i + j]) f = 0;
    }
  }
  if (f) return "aaaa";
  f = 1;
  for (int i = 0; i < n; i += 4) {
    if (s[i] != s[i + 1]) f = 0;
    if (s[i + 2] != s[i + 3]) f = 0;
  }
  if (f) return "aabb";
  f = 1;
  for (int i = 0; i < n; i += 4) {
    if (s[i] != s[i + 2]) f = 0;
    if (s[i + 1] != s[i + 3]) f = 0;
  }
  if (f) return "abab";
  f = 1;
  for (int i = 0; i < n; i += 4) {
    if (s[i] != s[i + 3]) f = 0;
    if (s[i + 1] != s[i + 2]) f = 0;
  }
  if (f) return "abba";
  return "NO";
}
inline bool vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
inline int getpos(const string& s, int k) {
  int cnt = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (vowel(s[i])) cnt++;
    if (cnt == k) return i;
  }
  return -1;
}
int main() {
  cin >> n >> k;
  n *= 4;
  gets(garbage);
  for (int i = 0; i < n; i++) {
    gets(buf);
    string cur = string(buf);
    int idx = getpos(cur, k);
    if (idx == -1) {
      cout << "NO\n";
      return 0;
    }
    s[i] = cur.substr(idx);
  }
  cout << check() << endl;
  return 0;
}
