#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int n, k;
int gao(string s, int k) {
  int m = s.size();
  for (int i = m - 1; i >= 0; i--) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
        s[i] == 'u') {
      k--;
      if (k == 0) return i;
    }
  }
  return -1;
}
int c[4] = {0};
string s1, s2, s3, s4;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> s1 >> s2 >> s3 >> s4;
    int a1 = gao(s1, k), a2 = gao(s2, k), a3 = gao(s3, k), a4 = gao(s4, k);
    if (a1 == -1) {
      puts("NO");
      return 0;
    } else
      s1 = s1.substr(a1, s1.size() - a1);
    if (a2 == -1) {
      puts("NO");
      return 0;
    } else
      s2 = s2.substr(a2, s2.size() - a2);
    if (a3 == -1) {
      puts("NO");
      return 0;
    } else
      s3 = s3.substr(a3, s3.size() - a3);
    if (a4 == -1) {
      puts("NO");
      return 0;
    } else
      s4 = s4.substr(a4, s4.size() - a4);
    if (s1 == s2 && s1 == s3 && s1 == s4)
      c[3]++;
    else if (s1 == s2 && s3 == s4)
      c[0]++;
    else if (s1 == s3 && s2 == s4)
      c[1]++;
    else if (s1 == s4 && s2 == s3)
      c[2]++;
    else {
      puts("NO");
      return 0;
    }
  }
  int idx = -1;
  for (int i = 0; i < 3; i++) {
    if (c[i]) {
      if (idx != -1) {
        puts("NO");
        return 0;
      }
      idx = i;
    }
  }
  if (idx == -1)
    puts("aaaa");
  else if (idx == 0)
    puts("aabb");
  else if (idx == 1)
    puts("abab");
  else
    puts("abba");
  return 0;
}
