#include <bits/stdc++.h>
using namespace std;
int n, k, len, cur, r[2510], size;
string s[5], sub[5];
bool ok;
bool check(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'u' || ch == 'o')
    return true;
  return false;
}
int rifm(string s1, string s2, string s3, string s4) {
  if (s1 == s2 && s1 == s3 && s1 == s4)
    return 4;
  else if (s1 == s2 && s3 == s4)
    return 1;
  else if (s1 == s3 && s2 == s4)
    return 2;
  else if (s1 == s4 && s2 == s3)
    return 3;
  else
    return 0;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 4; j++) cin >> s[j];
    for (int j = 1; j <= 4; j++) {
      len = s[j].length() - 1;
      cur = 0;
      sub[j] = "A";
      while (len != -1) {
        if (check(s[j][len])) cur++;
        if (cur == k) {
          int leng = s[j].length();
          sub[j] = s[j].substr(len, leng - len + 1);
          break;
        }
        len--;
      }
      if (sub[j] == "A") ok = true;
    }
    r[size++] = rifm(sub[1], sub[2], sub[3], sub[4]);
  }
  if (ok) {
    cout << "NO";
    return 0;
  }
  sort(r, r + size);
  if (r[0] == 0) {
    cout << "NO";
    return 0;
  }
  int ans = r[0];
  for (int i = 0; i < size; i++) {
    if (r[i] != r[0] && r[i] != 4) {
      cout << "NO";
      return 0;
    }
  }
  if (r[0] == 1)
    cout << "aabb";
  else if (r[0] == 2)
    cout << "abab";
  else if (r[0] == 3)
    cout << "abba";
  else
    cout << "aaaa";
  return 0;
}
