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