#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mymap;
  map<string, int>::iterator it;
  mymap["aaaa"] = 0;
  mymap["aabb"] = 0;
  mymap["abab"] = 0;
  mymap["abba"] = 0;
  int n, k2;
  cin >> n >> k2;
  int k5 = 0, k10 = 0;
  for (int j = 0; j < 4 * n; j = j + 4) {
    string a[5];
    vector<string> b;
    for (int i = 0; i < 4; i++) {
      cin >> a[i];
      int k1 = 0, k;
      for (k = a[i].size() - 1; k >= 0; k--) {
        if (a[i][k] == 'a' || a[i][k] == 'e' || a[i][k] == 'i' ||
            a[i][k] == 'o' || a[i][k] == 'u') {
          k1++;
        }
        if (k1 == k2) break;
      }
      if (a[i].size() > 1) {
        string a2 = " ";
        for (int i3 = k; i3 < a[i].size(); i3++) a2 = a2 + a[i][i3];
        b.push_back(a2);
      } else {
        b.push_back(a[i]);
      }
      if (k2 > a[i].size()) {
        k10 = 1;
      }
    }
    string a4;
    if (b[0] == b[1] && b[2] == b[3] && b[2] == b[1]) {
      a4 = "aaaa";
    } else if (b[0] == b[1] && b[2] == b[3]) {
      a4 = "aabb";
    } else if (b[0] == b[2] && b[1] == b[3]) {
      a4 = "abab";
    } else if (b[0] == b[3] && b[1] == b[2]) {
      a4 = "abba";
    } else {
      a4 = "bbbb";
      k5 = 1;
    }
    if (a4 != "bbbb") mymap[a4]++;
  }
  int m = 0;
  int k6 = 0, k7 = 0;
  string a6;
  if (mymap["aaaa"] == 0) {
    for (it = mymap.begin(); it != mymap.end(); it++) {
      if ((*it).second != 0) {
        a6 = (*it).first;
        k7++;
      }
    }
  } else {
    a6 = "aaaa";
    k6 = 1;
    for (it = mymap.begin(); it != mymap.end(); it++) {
      if ((*it).second != 0 && (*it).first != "aaaa") {
        a6 = (*it).first;
        k7++;
      }
    }
    if (mymap[a6] < mymap["aaaa"]) a6 = "aaaa";
  }
  if (mymap["aabb"] != 0 && mymap["abab"] != 0) k7 = -1;
  if (k10 != 1) {
    if (k7 == 1 || (k7 == 0 && k6 == 1) && (k5 != 1))
      cout << a6 << endl;
    else
      cout << "NO" << endl;
  } else {
    cout << "NO" << endl;
  }
}
