#include <bits/stdc++.h>
using namespace std;
char s1[100100], s2[5][100100], num[5];
void solve() {
  int i, j, k, n, t, p, p2, len, f12, f13, f14, f23, f24, f34, T;
  scanf("%d%d", &n, &k);
  memset(num, 0, sizeof(num));
  bool flag = true;
  for (T = 1; T <= n; T++) {
    for (t = 1; t <= 4; t++) {
      scanf("%s", s1);
      len = strlen(s1);
      p = k;
      for (i = len; i >= 1 && p > 0; i--) {
        s2[t][len - i] = s1[i - 1];
        if (s1[i - 1] == 'a' || s1[i - 1] == 'e' || s1[i - 1] == 'i' ||
            s1[i - 1] == 'o' || s1[i - 1] == 'u')
          p--;
      }
      s2[t][len - i] = '\0';
      if (p > 0) flag = false;
    }
    f12 = strcmp(s2[1], s2[2]);
    f13 = strcmp(s2[1], s2[3]);
    f14 = strcmp(s2[1], s2[4]);
    f23 = strcmp(s2[2], s2[3]);
    f24 = strcmp(s2[2], s2[4]);
    f34 = strcmp(s2[3], s2[4]);
    if (f12 == 0 && f34 == 0 && f13 == 0)
      num[1] = num[1] + 1;
    else if (f12 == 0 && f34 == 0)
      num[2] = num[2] + 1;
    else if (f13 == 0 && f24 == 0)
      num[3] = num[3] + 1;
    else if (f14 == 0 && f23 == 0)
      num[4] = num[4] + 1;
    else
      flag = false;
  }
  int ans = 0;
  for (i = 2; i <= 4; i++)
    if (num[i] != 0) ans++;
  if (ans > 1) flag = false;
  if (!flag)
    printf("NO\n");
  else {
    if (num[2] != 0)
      printf("aabb\n");
    else if (num[3] != 0)
      printf("abab\n");
    else if (num[4] != 0)
      printf("abba\n");
    else
      printf("aaaa\n");
  }
}
int main() { solve(); }
