#include <bits/stdc++.h>
using namespace std;
int countbit(int n) { return (n == 0) ? 0 : (1 + countbit(n & (n - 1))); }
int lowbit(int n) { return (n ^ (n - 1)) & n; }
const double pi = acos(-1.0);
const double eps = 1e-11;
char str[4][10010];
int N, K;
char mode[4][5] = {"aaaa", "aabb", "abba", "abab"};
int getMode() {
  int x[4];
  for (int i = 0; i < 4; ++i) {
    x[i] = -1;
    int len = strlen(str[i]);
    for (int j = len - 1, index = 0; j >= 0; --j) {
      if (str[i][j] == 'i' || str[i][j] == 'e' || str[i][j] == 'o' ||
          str[i][j] == 'u' || str[i][j] == 'a')
        index++;
      if (index == K) {
        x[i] = j;
        break;
      }
    }
    if (x[i] == -1) return -1;
  }
  int mat[4][4] = {};
  for (int i = 0; i < 4; ++i)
    for (int j = i + 1; j < 4; ++j)
      mat[i][j] = strcmp(str[i] + x[i], str[j] + x[j]);
  if (mat[0][2] == 0 && mat[0][1] == 0 && mat[0][3] == 0) return 0;
  if (mat[0][1] == 0 && mat[2][3] == 0) return 1;
  if (mat[0][3] == 0 && mat[1][2] == 0) return 2;
  if (mat[0][2] == 0 && mat[1][3] == 0) return 3;
  return -1;
}
int main() {
  int m = -1;
  scanf("%d%d", &N, &K);
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < 4; ++j) scanf("%s", str[j]);
    int tm = getMode();
    if (tm == -1) {
      m = -1;
      break;
    } else if (m == -1)
      m = tm;
    else if (m == 0)
      m = tm;
    else if (tm == 0)
      m = m;
    else if (m != tm) {
      m = -1;
      break;
    }
  }
  if (m == -1)
    printf("NO\n");
  else
    printf("%s\n", mode[m]);
  return 0;
}
