#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  int i, j;
  cin >> n >> k;
  bool ac = true;
  string ans;
  for (i = 0; i < n; i++) {
    string ss, s[4], str;
    str = "a   ";
    for (j = 0; j < 4; j++) {
      cin >> ss;
      s[j] = "";
      int t = 0;
      for (int h = ss.length() - 1; h >= 0; h--) {
        if (ss[h] == 'a' || ss[h] == 'i' || ss[h] == 'o' || ss[h] == 'u' ||
            ss[h] == 'e')
          t++;
        s[j] += ss[h];
        if (t >= k) break;
      }
      if (t < k) {
        ac = false;
      }
    }
    int c = 1;
    for (j = 1; j < 4; j++) {
      int x;
      for (x = 0; x < j; x++) {
        if (s[x] == s[j]) {
          str[j] = str[x];
          break;
        }
      }
      if (x >= j) {
        str[j] = 'a' + c;
        c++;
      }
    }
    if (i == 0 || ans == "aaaa") {
      ans = str;
    }
    if (ans != str && str != "aaaa") ac = false;
  }
  if (!ac) {
    cout << "NO" << endl;
  } else {
    if (ans == "aaaa" || ans == "aabb" || ans == "abba" || ans == "abab")
      cout << ans << endl;
    else
      cout << "NO" << endl;
  }
}
