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