#include <bits/stdc++.h>
using namespace std;
const int maxl = 10000 + 10;
inline bool glas(char c) {
  return (c == 'a') || (c == 'e') || (c == 'i') || (c == 'o') || (c == 'u');
}
bool equ(char s1[], int pos1, char s2[], int pos2) {
  if (pos1 == -1 || pos2 == -1) return false;
  int l1 = strlen(s1);
  int l2 = strlen(s2);
  if (l1 - pos1 == l2 - pos2) {
    for (; pos1 < l1 && pos2 < l2; ++pos1, ++pos2)
      if (s1[pos1] != s2[pos2]) return false;
    return true;
  } else
    return false;
}
char a[4][maxl];
int pos[4];
bool eq[4][4];
int ans;
int main() {
  int n, k;
  scanf("%d%d\n", &n, &k);
  ans = 3;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) {
      gets(a[j]);
      pos[j] = strlen(a[j]);
      for (int g = 0; pos[j] >= 0 && g < k;) {
        if (pos[j] == 0) {
          if (g != k)
            pos[j] = -1;
          else
            break;
        } else {
          if (glas(a[j][pos[j] - 1])) ++g;
          --pos[j];
        }
      }
    }
    memset(eq, 0, sizeof eq);
    for (int j1 = 0; j1 < 4; ++j1)
      for (int j2 = j1 + 1; j2 < 4; ++j2)
        eq[j1][j2] = equ(a[j1], pos[j1], a[j2], pos[j2]);
    int z = 0;
    int newans = 4;
    for (int j1 = 0; j1 < 4; ++j1)
      for (int j2 = j1 + 1; j2 < 4; ++j2)
        if (eq[j1][j2]) ++z;
    if (z == 6)
      newans = 3;
    else if (z == 2) {
      if (eq[0][1] && eq[2][3]) newans = 0;
      if (eq[0][2] && eq[1][3]) newans = 1;
      if (eq[0][3] && eq[1][2]) newans = 2;
    }
    if (ans == 3)
      ans = newans;
    else if (newans == 4)
      ans = 4;
    else if (newans != 3)
      if (ans != newans) ans = 4;
  }
  if (ans == 0)
    printf("aabb\n");
  else if (ans == 1)
    printf("abab\n");
  else if (ans == 2)
    printf("abba\n");
  else if (ans == 3)
    printf("aaaa\n");
  else
    printf("NO\n");
  return 0;
}
