#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<string> s;
  for (int i = 0; i < 4 * n; i++) {
    string p;
    cin >> p;
    string temp;
    int count = 0;
    for (int j = 0; j < p.size(); j++) {
      if (p[j] == 'a' || p[j] == 'e' || p[j] == 'i' || p[j] == 'o' ||
          p[j] == 'u')
        count++;
    }
    if (count < k) {
      cout << "NO";
      exit(0);
    }
    count = 0;
    for (int j = p.size() - 1; j >= 0; j--) {
      temp.push_back(p[j]);
      if (p[j] == 'a' || p[j] == 'e' || p[j] == 'i' || p[j] == 'o' ||
          p[j] == 'u')
        count++;
      if (count == k) break;
    }
    s.push_back(temp);
  }
  string a[] = {"aaaa", "aabb", "abab", "abba"};
  vector<vector<int> > l;
  for (int i = 0; i < s.size(); i = i + 4) {
    vector<int> temp;
    if (s[i] == s[i + 1] && s[i] == s[i + 2] && s[i] == s[i + 3])
      temp.push_back(0);
    if (s[i] == s[i + 1] && s[i + 2] == s[i + 3]) temp.push_back(1);
    if (s[i] == s[i + 2] && s[i + 1] == s[i + 3]) temp.push_back(2);
    if (s[i] == s[i + 3] && s[i + 1] == s[i + 2]) temp.push_back(3);
    if (temp.size() == 0) {
      cout << "NO";
      exit(0);
    }
    l.push_back(temp);
  }
  for (int i = 0; i < l.size(); i++) {
    for (int j = 0; j < l[i].size(); j++) {
      int flag = 0;
      for (int k = 0; k < l.size(); k++) {
        if (k != i) {
          for (int m = 0; m < l[k].size(); m++)
            if (l[k][m] == l[i][j]) flag++;
        }
      }
      if (flag == l.size() - 1) {
        cout << a[l[i][j]];
        exit(0);
      }
    }
  }
  cout << "NO";
  return 0;
}
