#include <bits/stdc++.h>
int len;
int n, k;
int s[5], l[5];
bool check[2510][5];
bool answer[5];
char tmp[5][10010], suffix[5][10010];
bool flag = false;
bool same(int a, int b) {
  int i;
  if (s[a] != s[b]) return false;
  for (i = 1; i <= s[a]; i++) {
    if (suffix[a][i] != suffix[b][i]) return false;
  }
  return true;
}
int main(void) {
  int len, i, j, K, cnt;
  scanf("%d %d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%s", &tmp[1][1]);
    scanf("%s", &tmp[2][1]);
    scanf("%s", &tmp[3][1]);
    scanf("%s", &tmp[4][1]);
    l[1] = strlen(&tmp[1][1]), l[2] = strlen(&tmp[2][1]),
    l[3] = strlen(&tmp[3][1]), l[4] = strlen(&tmp[4][1]);
    for (K = 1; K <= 4; K++) {
      cnt = k;
      s[K] = 0;
      for (j = l[K]; j >= 1; j--) {
        if (tmp[K][j] == 'a' || tmp[K][j] == 'e' || tmp[K][j] == 'i' ||
            tmp[K][j] == 'o' || tmp[K][j] == 'u')
          cnt--;
        suffix[K][++s[K]] = tmp[K][j];
        if (cnt == 0) break;
      }
      if (cnt != 0) {
        printf("NO\n");
        flag = true;
        break;
      }
    }
    if (flag) break;
    if (same(1, 2) && same(3, 4)) check[i][1] = true;
    if (same(1, 3) && same(2, 4)) check[i][2] = true;
    if (same(1, 4) && same(2, 3)) check[i][3] = true;
    if (same(1, 2) && same(2, 3) && same(3, 4)) check[i][4] = true;
  }
  if (!flag) {
    answer[1] = answer[2] = answer[3] = answer[4] = 1;
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= 4; j++) {
        answer[j] *= check[i][j];
      }
    }
    if (answer[4])
      printf("aaaa\n");
    else if (answer[3])
      printf("abba\n");
    else if (answer[2])
      printf("abab\n");
    else if (answer[1])
      printf("aabb\n");
    else
      printf("NO\n");
  }
  return false;
}
