#include <bits/stdc++.h>
int i, j, k, n, m, t;
typedef char string[10001];
int main() {
  fscanf(stdin, "%d%d", &n, &k);
  char* res[5];
  res[0] = "aaaa\n";
  res[1] = "aabb\n";
  res[2] = "abab\n";
  res[3] = "abba\n";
  res[4] = "NO\n";
  bool b[4];
  string s[4];
  char* suf[4];
  for (i = (0); i < (4); i++) b[i] = true;
  for (i = (0); i < (n); i++) {
    for (j = (0); j < (4); j++) {
      fscanf(stdin, "%s", s[j]);
      for (t = k, suf[j] = s[j] + strlen(s[j]); suf[j] > s[j] && t > 0;) {
        suf[j]--;
        switch (*suf[j]) {
          case 'a':
          case 'e':
          case 'i':
          case 'o':
          case 'u':
            t--;
        }
      }
      if (t > 0) {
        printf("NO\n");
        return 0;
      }
    }
    for (j = (1); j < (4); j++) {
      if ((b[0] || b[j]) && strcmp(suf[0], suf[j])) b[0] = b[j] = false;
      if (b[j] && strcmp(suf[j % 3 + 1], suf[(j + 1) % 3 + 1])) b[j] = false;
    }
  }
  for (i = (0); i < (4); i++)
    if (b[i]) break;
  printf(res[i]);
  return 0;
}
