#include <bits/stdc++.h>
using namespace std;
int n, k, m;
string s[100005];
int is_vol(char c) {
  string t = "aeiou";
  for (int i = 0; i < t.size(); i++) {
    if (c == t[i]) return 1;
  }
  return 0;
}
int ok(vector<string> v) {
  if (v.size() == 0) return 1;
  set<string> v2;
  for (int i = 0; i < v.size(); i++) {
    string temp;
    int cnt = 0;
    int ok = 0;
    for (int j = 0; j < v[i].size(); j++) {
      if (is_vol(v[i][j])) {
        cnt++;
      }
      if (!ok) temp += v[i][j];
      if (cnt == k) {
        ok = 1;
      }
    }
    if (!ok) return 0;
    v2.insert(temp);
  }
  if (v2.size() == 1) return 1;
  return 0;
}
int solve(string t) {
  vector<int> A, B;
  for (int i = 0; i < 4; i++) {
    if (t[i] == 'a') {
      A.push_back(i);
    } else {
      B.push_back(i);
    }
  }
  for (int i = 0; i < m; i += 4) {
    string c[4];
    c[0] = s[i];
    c[1] = s[i + 1];
    c[2] = s[i + 2];
    c[3] = s[i + 3];
    vector<string> v1, v2;
    for (int j = 0; j < A.size(); j++) {
      v1.push_back(c[A[j]]);
    }
    for (int j = 0; j < B.size(); j++) {
      v2.push_back(c[B[j]]);
    }
    if (ok(v1) && ok(v2)) {
    } else
      return 0;
  }
  return 1;
}
int main() {
  cin >> n >> k;
  m = n * 4;
  for (int i = 0; i < m; i++) {
    cin >> s[i];
    reverse(s[i].begin(), s[i].end());
  }
  if (solve("aaaa")) {
    cout << "aaaa";
  } else if (solve("aabb")) {
    cout << "aabb";
  } else if (solve("abab")) {
    cout << "abab";
  } else if (solve("abba")) {
    cout << "abba";
  } else {
    cout << "NO";
  }
}
