#include <bits/stdc++.h>
using namespace std;
int n, k;
bool aabb = 1, abab = 1, abba = 1;
int p1, p2, p3, p4, l1, l2, l3, l4;
char s1[10005] = {0}, s2[10005] = {0}, s3[10005] = {0}, s4[10005] = {0};
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%s%s%s%s", &s1, &s2, &s3, &s4);
    l1 = strlen(s1);
    l2 = strlen(s2);
    l3 = strlen(s3);
    l4 = strlen(s4);
    int k1 = 0;
    for (int i = 1; i <= l1; ++i) {
      if (s1[l1 - i] == 'a' || s1[l1 - i] == 'e' || s1[l1 - i] == 'i' ||
          s1[l1 - i] == 'o' || s1[l1 - i] == 'u')
        ++k1;
      if (l2 - i < 0 || s1[l1 - i] != s2[l2 - i]) aabb = 0;
      if (l3 - i < 0 || s1[l1 - i] != s3[l3 - i]) abab = 0;
      if (l4 - i < 0 || s1[l1 - i] != s4[l4 - i]) abba = 0;
      if (k1 == k) break;
    }
    if (k1 < k) {
      aabb = abba = abab = 0;
      break;
    }
    k1 = 0;
    for (int i = 1; i <= l2; ++i) {
      if (s2[l2 - i] == 'a' || s2[l2 - i] == 'e' || s2[l2 - i] == 'i' ||
          s2[l2 - i] == 'o' || s2[l2 - i] == 'u')
        ++k1;
      if (l3 - i < 0 || s2[l2 - i] != s3[l3 - i]) abba = 0;
      if (l4 - i < 0 || s2[l2 - i] != s4[l4 - i]) abab = 0;
      if (k1 == k) break;
    }
    if (k1 < k) {
      aabb = abba = abab = 0;
      break;
    }
    k1 = 0;
    for (int i = 1; i <= l3; ++i) {
      if (s3[l3 - i] == 'a' || s3[l3 - i] == 'e' || s3[l3 - i] == 'i' ||
          s3[l3 - i] == 'o' || s3[l3 - i] == 'u')
        ++k1;
      if (l4 - i < 0 || s3[l3 - i] != s4[l4 - i]) aabb = 0;
      if (k1 == k) break;
    }
    if (k1 < k) {
      aabb = abba = abab = 0;
      break;
    }
  }
  if (abab && abba && aabb)
    printf("aaaa\n");
  else if (abab)
    printf("abab\n");
  else if (abba)
    printf("abba\n");
  else if (aabb)
    printf("aabb\n");
  else
    printf("NO\n");
  return 0;
}
