#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
char str[maxn][maxn];
int trie[maxn * 100][30];
int color[maxn * 100];
int root;
int n, k;
int check(char *s) {
  int len = strlen(s);
  int p = 0;
  int tmp = 0;
  for (int i = len - 1; i >= 0; --i) {
    int c = s[i] - 'a';
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
      ++tmp;
    if (!trie[p][c]) return 0;
    p = trie[p][c];
    if (tmp >= k) break;
  }
  return color[p];
}
bool Insert(char *s, int cnt) {
  int len = strlen(s);
  int p = 0;
  int tmp = 0;
  for (int i = len - 1; i >= 0; --i) {
    int c = s[i] - 'a';
    if (!trie[p][c]) {
      trie[p][c] = root;
      root++;
    }
    p = trie[p][c];
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
      ++tmp;
    if (tmp >= k) break;
  }
  color[p] = cnt;
  return tmp >= k;
}
int table[5][4] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1};
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= 4 * n; ++i) scanf("%s", str[i]);
  int ok[5] = {0};
  vector<int> v;
  for (int i = 1; i <= 4 * n; i += 4) {
    root = 1;
    v.clear();
    int cnt = 1;
    for (int j = 0; j < 4; ++j) {
      int tmp = check(str[i + j]);
      if (tmp == 0) {
        if (!Insert(str[i + j], cnt)) {
          printf("NO\n");
          return 0;
        }
        v.push_back(cnt);
        ++cnt;
      } else
        v.push_back(tmp);
    }
    if (cnt > 3) {
      printf("NO\n");
      return 0;
    }
    int oooook = 0;
    for (int j = 1; j <= 4; ++j) {
      int flag = 1;
      for (int lll = 0; lll < 4; ++lll) {
        if (table[j][lll] != v[lll]) flag = 0;
      }
      if (flag) {
        oooook = 1;
        ++ok[j];
        break;
      }
    }
    if (!oooook) {
      printf("NO\n");
      return 0;
    }
    for (int lll = 0; lll <= root + 10; ++lll) {
      color[lll] = 0;
      for (int j = 0; j < 27; ++j) trie[lll][j] = 0;
    }
  }
  int coun = 0, id = 0;
  for (int i = 2; i <= 4; ++i)
    if (ok[i]) {
      ++coun;
      id = i;
    }
  if (coun >= 2) {
    printf("NO\n");
  } else {
    if (id == 0) {
      if (ok[1])
        printf("aaaa\n");
      else {
        printf("NO\n");
      }
    } else {
      if (id == 2)
        printf("aabb\n");
      else if (id == 3)
        printf("abab\n");
      else
        printf("abba\n");
    }
  }
  return 0;
}
