#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
vector<long long> hashes;
set<char> vowels;
int main() {
  vowels.insert('a');
  vowels.insert('e');
  vowels.insert('i');
  vowels.insert('o');
  vowels.insert('u');
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < 4 * n; ++i) {
    getchar();
    char s[10001];
    scanf("%s", s);
    int len = strlen(s);
    int cc = 0;
    for (int j = len - 1; j >= 0; --j) {
      if (vowels.find(s[j]) != vowels.end()) ++cc;
      if (cc == k) {
        long long hash = s[j];
        for (int m = j + 1; m < len; ++m) {
          hash = (((hash * 57) % MOD) + s[m]) % MOD;
        }
        hashes.push_back(hash);
        break;
      }
    }
  }
  int lim = hashes.size();
  if (lim != 4 * n) {
    printf("NO\n");
    return 0;
  }
  int ans = -1;
  for (int i = 0; i + 4 <= lim; i = i + 4) {
    long long x0 = hashes[i];
    long long x1 = hashes[i + 1];
    long long x2 = hashes[i + 2];
    long long x3 = hashes[i + 3];
    if ((x0 == x1) && (x1 == x2) && (x2 == x3) && (ans == -1)) {
      ans = 1;
    }
    if ((x0 == x1) && (x2 == x3) && (x1 != x2)) {
      if ((ans != -1) && (ans != 1) && (ans != 3)) {
        ans = -1;
        break;
      }
      if ((ans == -1) || (ans == 1)) ans = 3;
    }
    if ((x0 == x2) && (x1 == x3) && (x0 != x3)) {
      if ((ans != -1) && (ans != 1) && (ans != 2)) {
        ans = -1;
        break;
      }
      if ((ans == -1) || (ans == 1)) ans = 2;
    }
    if ((x0 == x3) && (x1 == x2) && (x1 != x0)) {
      if ((ans != -1) && (ans != 1) && (ans != 4)) {
        ans = -1;
        break;
      }
      if ((ans == -1) || (ans == 1)) ans = 4;
    }
    if (ans == -1) break;
  }
  switch (ans) {
    case 1: {
      printf("aaaa\n");
    } break;
    case 2: {
      printf("abab\n");
    } break;
    case 3: {
      printf("aabb\n");
    } break;
    case 4: {
      printf("abba\n");
    } break;
    default: {
      printf("NO\n");
    }
  }
  return 0;
}
