#include <bits/stdc++.h>
using namespace std;
inline bool nvowelp(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
    return 1;
  else
    return 0;
}
int getplace(char *s, int k) {
  int i = strlen(s);
  while (i--) {
    if (nvowelp(s[i])) k--;
    if (!k) break;
  }
  if (k) return -1;
  return i;
}
inline bool judge(char *s1, char *s2, int k) {
  int p1 = getplace(s1, k), p2 = getplace(s2, k);
  if (p1 < 0 || p2 < 0) return 0;
  if (strcmp(s1 + p1, s2 + p2) == 0)
    return 1;
  else
    return 0;
}
int multijudge(char *s1, char *s2, char *s3, char *s4, int k) {
  int state;
  if (judge(s1, s2, k)) {
    if (judge(s3, s4, k)) {
      if (judge(s1, s3, k))
        state = 0;
      else
        state = 1;
    } else
      state = -1;
  } else if (judge(s1, s3, k)) {
    if (judge(s2, s4, k))
      state = 2;
    else
      state = -1;
  } else if (judge(s1, s4, k)) {
    if (judge(s2, s3, k))
      state = 3;
    else
      state = -1;
  } else
    state = -1;
  return state;
}
int main() {
  int n, k, state = 0;
  scanf("%d %d", &n, &k);
  int i;
  char s1[10010], s2[10010], s3[10010], s4[10010];
  for (i = 0; i < n; i++) {
    scanf("%s %s %s %s", s1, s2, s3, s4);
    int tmp = multijudge(s1, s2, s3, s4, k);
    if (state == 0)
      state = tmp;
    else if (state == -1)
      break;
    else if (state != tmp && tmp != 0)
      state = -1;
  }
  switch (state) {
    case -1:
      cout << "NO";
      break;
    case 0:
      cout << "aaaa";
      break;
    case 1:
      cout << "aabb";
      break;
    case 2:
      cout << "abab";
      break;
    case 3:
      cout << "abba";
      break;
  }
  cout << endl;
}
