#include <bits/stdc++.h>
using namespace std;
int n, K;
string res[] = {"aabb", "abab", "abba", "aaaa"};
bool rhymes(string a, string b) {
  string ta = "!!!", tb = "###";
  int k = K;
  for (int i = a.length() - 1; i >= 0; i--) {
    if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u')
      k--;
    if (k == 0) {
      ta = a.substr(i);
      break;
    }
  }
  k = K;
  for (int i = b.length() - 1; i >= 0; i--) {
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' || b[i] == 'u')
      k--;
    if (k == 0) {
      tb = b.substr(i);
      break;
    }
  }
  return ta == tb;
}
int main() {
  while (cin >> n >> K) {
    bool cannot[4];
    memset(cannot, 0, sizeof(cannot));
    for (int(i) = 0; (i) < (n); (i)++) {
      vector<string> q;
      for (int(j) = 0; (j) < (4); (j)++) {
        string s;
        cin >> s;
        q.push_back(s);
      }
      bool rhyme[4][4];
      memset(rhyme, 0, sizeof(rhyme));
      for (int(j) = 0; (j) < (4); (j)++) {
        for (int k = j + 1; k < 4; k++) {
          if (rhymes(q[j], q[k])) {
            rhyme[j][k] = 1;
            rhyme[k][j] = 1;
          }
        }
      }
      if (!(rhyme[0][1] && rhyme[2][3])) cannot[0] = 1;
      if (!(rhyme[0][2] && rhyme[1][3])) cannot[1] = 1;
      if (!(rhyme[0][3] && rhyme[1][2])) cannot[2] = 1;
      if (!(rhyme[0][1] && rhyme[1][2] && rhyme[2][3] && rhyme[3][1]))
        cannot[3] = 1;
    }
    if (!cannot[3])
      cout << res[3] << endl;
    else {
      bool can = 0;
      for (int i = 0; i < 3; i++) {
        if (!cannot[i]) {
          cout << res[i] << endl;
          can = 1;
          break;
        }
      }
      if (!can) cout << "NO" << endl;
    }
  }
}
