#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, sp = -1;
  scanf("%d%d\n", &n, &k);
  vector<string> v;
  for (int i = 0; i < n; i++) {
    v.clear();
    int a;
    for (int j = 0; j < 4; j++) {
      string s;
      getline(cin, s);
      int b = k, pos = -1;
      for (int z = s.size() - 1; z >= 0; z--) {
        if (s[z] == 'a' || s[z] == 'e' || s[z] == 'i' || s[z] == 'o' ||
            s[z] == 'u')
          b--;
        if (!b) {
          pos = z;
          break;
        }
      }
      if (pos == -1) {
        puts("NO");
        return 0;
      }
      v.push_back(s.substr(pos));
    }
    a = -1;
    if (v[0] == v[3] && v[1] == v[2]) a = 3;
    if (v[0] == v[1] && v[2] == v[3]) a = 1;
    if (v[0] == v[2] && v[1] == v[3]) a = 2;
    if (v[0] == v[2] && v[0] == v[3] && v[0] == v[1]) a = 4;
    if (a == -1) {
      puts("NO");
      return 0;
    }
    if (sp == -1 || sp == 4)
      sp = a;
    else if (a != 4 && a != sp) {
      puts("NO");
      return 0;
    }
  }
  if (sp == 1)
    cout << "aabb\n";
  else if (sp == 2)
    cout << "abab\n";
  else if (sp == 3)
    cout << "abba\n";
  else
    cout << "aaaa\n";
}
