#include <bits/stdc++.h>
using namespace std;
int isVowel(int c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
int main() {
  int n, k;
  cin >> n >> k;
  int aabb = 1, abba = 1, abab = 1;
  for (int i = 0; i < n; i++) {
    vector<string> vs(4);
    for (int i = 0; i < 4; i++) {
      cin >> vs[i];
      int j, c;
      for (c = 0, j = vs[i].size() - 1; c < k && j >= 0; --j)
        if (isVowel(vs[i][j])) c++;
      if (c == k)
        vs[i] = vs[i].substr(j + 1);
      else {
        cout << "NO\n";
        return 0;
      }
    }
    if (vs[0] != vs[1] || vs[2] != vs[3]) aabb = 0;
    if (vs[0] != vs[2] || vs[1] != vs[3]) abab = 0;
    if (vs[0] != vs[3] || vs[1] != vs[2]) abba = 0;
  }
  if (aabb && abab)
    cout << "aaaa\n";
  else if (aabb)
    cout << "aabb\n";
  else if (abab)
    cout << "abab\n";
  else if (abba)
    cout << "abba\n";
  else
    cout << "NO\n";
  return 0;
}
