#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 29);
int n, k;
string str[2505][4], rhy[2505];
int sch[4];
string sub(string s, int k) {
  string res = "";
  int t = k;
  for (int i = s.size() - 1; i >= 0; --i) {
    res = s[i] + res;
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
        s[i] == 'u') {
      --t;
      if (t == 0) {
        break;
      }
    }
  }
  if (t != 0) {
    return "";
  }
  return res;
}
string find_rhy(int i) {
  if (str[i][0] == str[i][1] && str[i][1] == str[i][2] &&
      str[i][0] == str[i][3]) {
    return "aaaa";
  }
  if (str[i][0] == str[i][1] && str[i][2] == str[i][3]) {
    return "aabb";
  }
  if (str[i][0] == str[i][2] && str[i][1] == str[i][3]) {
    return "abab";
  }
  if (str[i][0] == str[i][3] && str[i][1] == str[i][2]) {
    return "abba";
  }
  return "NO";
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  bool f = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) {
      string s;
      cin >> s;
      str[i][j] = sub(s, k);
      if (str[i][j] == "") {
        f = 0;
      }
    }
  }
  if (f == 0) {
    cout << "NO\n";
    exit(0);
  }
  for (int i = 0; i < n; ++i) {
    rhy[i] = find_rhy(i);
  }
  string ans = rhy[0];
  for (int i = 1; i < n; ++i) {
    if (ans == "aaaa") {
      ans = rhy[i];
    } else if (ans == rhy[i] || rhy[i] == "aaaa") {
      ;
    } else {
      ans = "NO";
    }
  }
  cout << ans << '\n';
  return 0;
}
