#include <bits/stdc++.h>
using namespace std;
string s[4];
int poss[5], n, k;
bool yuanyin(char p) {
  if (p == 'a' || p == 'e' || p == 'i' || p == 'o' || p == 'u') return 1;
  return 0;
}
int pos(string ss, int k) {
  for (int l = ss.length(), j = l - 1; j >= 0; j--) {
    if (yuanyin(ss[j])) {
      k--;
      if (k <= 0) return j;
    }
  }
  return -1;
}
int main() {
  int i, j, flag, aaaa, aabb, abba, abab;
  while (scanf("%d%d", &n, &k) != EOF) {
    flag = aaaa = aabb = abba = abab = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < 4; j++) {
        cin >> s[j];
        if ((poss[j] = pos(s[j], k)) < 0) flag = 1;
      }
      if (flag == 0) {
        if (s[0].substr(poss[0]) == s[1].substr(poss[1]) &&
            s[2].substr(poss[2]) == s[3].substr(poss[3]) &&
            s[0].substr(poss[0]) == s[3].substr(poss[3]))
          aaaa++;
        if (s[0].substr(poss[0]) == s[1].substr(poss[1]) &&
            s[2].substr(poss[2]) == s[3].substr(poss[3]))
          aabb++;
        if (s[0].substr(poss[0]) == s[3].substr(poss[3]) &&
            s[2].substr(poss[2]) == s[1].substr(poss[1]))
          abba++;
        if (s[0].substr(poss[0]) == s[2].substr(poss[2]) &&
            s[1].substr(poss[1]) == s[3].substr(poss[3]))
          abab++;
      }
    }
    if (aaaa == n) {
      printf("aaaa\n");
      continue;
    }
    if (aabb == n) {
      printf("aabb\n");
      continue;
    }
    if (abba == n) {
      printf("abba\n");
      continue;
    }
    if (abab == n) {
      printf("abab\n");
      continue;
    }
    printf("NO\n");
  }
  return 0;
}
