#include <bits/stdc++.h>
using namespace std;
int main() {
  int ch[4];
  memset(ch, 0, sizeof(ch));
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    string s[4];
    cin >> s[0] >> s[1] >> s[2] >> s[3];
    string sub[4];
    for (int j = 0; j < 4; j++) {
      int len = s[j].length();
      int ll = len;
      int cou = 0;
      while (cou != k && ll >= 0)
        if (s[j][ll] == 'a' || s[j][ll] == 'e' || s[j][ll] == 'i' ||
            s[j][ll] == 'o' || s[j][ll] == 'u')
          cou++, ll--;
        else
          ll--;
      if (cou != k) {
        cout << "NO" << endl;
        return 0;
      }
      sub[j] = s[j].substr(ll + 1, len);
    }
    if (sub[0] == sub[1] && sub[1] == sub[2] && sub[2] == sub[3]) {
      ch[0]++;
      continue;
    }
    if (sub[0] == sub[1] && sub[2] == sub[3]) {
      ch[1]++;
      continue;
    }
    if (sub[0] == sub[2] && sub[1] == sub[3]) {
      ch[2]++;
      continue;
    }
    if (sub[0] == sub[3] && sub[1] == sub[2]) {
      ch[3]++;
      continue;
    }
  }
  if (ch[0] == n) {
    cout << "aaaa";
    return 0;
  }
  if (ch[1] + ch[0] == n) {
    cout << "aabb";
    return 0;
  }
  if (ch[2] + ch[0] == n) {
    cout << "abab";
    return 0;
  }
  if (ch[3] + ch[0] == n) {
    cout << "abba";
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
