#include <bits/stdc++.h>
using namespace std;
string type[2500];
string words[4], suff[4];
int main() {
  const string gl = "aeiou";
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) cin >> words[j];
    for (int j = 0; j < 4; j++) {
      suff[j] = "";
      int cnt = k;
      for (int p = words[j].length() - 1; p >= 0; p--) {
        if (gl.find(words[j][p]) != string::npos) {
          cnt--;
        }
        suff[j] += words[j][p];
        if (!cnt) break;
      }
      if (cnt) {
        cout << "NO";
        return 0;
      }
    }
    if (suff[0] == suff[1] && suff[0] == suff[2] && suff[0] == suff[3])
      type[i] = "aaaa";
    else if (suff[0] == suff[1] && suff[2] == suff[3])
      type[i] = "aabb";
    else if (suff[0] == suff[2] && suff[1] == suff[3])
      type[i] = "abab";
    else if (suff[0] == suff[3] && suff[1] == suff[2])
      type[i] = "abba";
    else {
      cout << "NO";
      return 0;
    }
  }
  string rifm = type[0];
  for (int i = 1; i < n; i++) {
    if (rifm == "aaaa" && type[i] != rifm)
      rifm = type[i];
    else if (rifm != "aaaa" && (type[i] == rifm || type[i] == "aaaa"))
      ;
    else if (rifm == type[i]) {
      continue;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << rifm;
  return 0;
}
