#include <bits/stdc++.h>
using namespace std;
int n, nk;
char s[4][10005];
int f[4][4];
int sce[4];
void cal(int i) {
  if (i == 0) puts("aaaa");
  if (i == 1) puts("aabb");
  if (i == 2) puts("abab");
  if (i == 3) puts("abba");
}
int main() {
  scanf("%d%d", &n, &nk);
  sce[0] = sce[1] = sce[2] = sce[3] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) scanf("%s", s[j]);
    memset(f, 0, sizeof(f));
    for (int j = 0; j < 4; j++)
      for (int k = j + 1; k < 4; k++) {
        int l1 = strlen(s[j]);
        int l2 = strlen(s[k]);
        int cnt = 0;
        for (int l = 1; l <= min(l1, l2); l++) {
          if (s[j][l1 - l] != s[k][l2 - l])
            break;
          else if (s[j][l1 - l] == 'a' || s[j][l1 - l] == 'e' ||
                   s[j][l1 - l] == 'i' || s[j][l1 - l] == 'o' ||
                   s[j][l1 - l] == 'u')
            cnt++;
        }
        if (cnt >= nk) f[j][k] = f[k][j] = 1;
      }
    bool flag;
    flag = (f[0][1] && f[0][2] && f[0][3] && f[0][4]);
    sce[0] &= flag;
    flag = (f[0][1] && f[2][3]);
    sce[1] &= flag;
    flag = (f[0][2] && f[1][3]);
    sce[2] &= flag;
    flag = (f[0][3] && f[1][2]);
    sce[3] &= flag;
  }
  for (int i = 0; i < 4; i++) {
    if (sce[i]) {
      cal(i);
      return 0;
    }
  }
  puts("NO");
}
