#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b != 0 ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a * (b / GCD(a, b)); }
long long Pow(long long n, long long e) {
  if (e == 0) return 1;
  if (e == 1)
    return n;
  else if (e & 1) {
    long long t = Pow(n, e / 2);
    return n * t * t;
  } else {
    long long t = Pow(n, e / 2);
    return t * t;
  }
}
int N, K;
bool OK(string& a, string& b) {
  int vovels = 0;
  for (int i = 0, max_ = (min((int)(a).size(), (int)(b).size())); i < max_;
       ++i) {
    char c1 = a[(int)(a).size() - 1 - i];
    char c2 = b[(int)(b).size() - 1 - i];
    if (c1 != c2)
      return false;
    else if (c1 == 'a' || c1 == 'e' || c1 == 'i' || c1 == 'o' || c1 == 'u')
      ++vovels;
    if (vovels == K) return true;
  }
  return false;
}
int main() {
  bool aabb = true, abab = true, abba = true;
  string s[4];
  scanf("%d %d", &N, &K);
  getline(cin, s[0]);
  for (int i = 0, max_ = (N); i < max_; ++i) {
    for (int j = 0, max_ = (4); j < max_; ++j) getline(cin, s[j]);
    if (aabb) {
      if (!OK(s[0], s[1]) || !OK(s[2], s[3])) {
        aabb = false;
      }
    }
    if (abab) {
      if (!OK(s[0], s[2]) || !OK(s[1], s[3])) {
        abab = false;
      }
    }
    if (abba) {
      if (!OK(s[0], s[3]) || !OK(s[1], s[2])) {
        abba = false;
      }
    }
  }
  if (aabb && abab && abba)
    printf("aaaa\n");
  else if (aabb)
    printf("aabb\n");
  else if (abab)
    printf("abab\n");
  else if (abba)
    printf("abba\n");
  else
    printf("NO\n");
  return 0;
}
