#include <bits/stdc++.h>
using namespace std;
int n, k, cntk;
string s[10009];
string sf, rh[2], rh1, common;
bool check(string ss) {
  if (ss != "aabb" && ss != "abab" && ss != "abba" && ss != "aaaa")
    return false;
  return true;
}
bool vowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < 4 * n; i++) cin >> s[i];
  for (int i = 0; i < 4 * n; i += 4) {
    rh1 = "";
    rh[0] = "";
    rh[1] = "";
    for (int j = 0; j < 4; j++) {
      sf = "";
      int ptr, n1;
      n1 = s[i + j].size();
      ptr = n1 - 1;
      cntk = 0;
      while (ptr >= 0 && cntk < k) {
        sf = s[i + j][ptr] + sf;
        if (vowel(s[i + j][ptr])) cntk++;
        ptr--;
      }
      if (cntk < k) {
        cout << "NO";
        return 0;
      }
      if (rh[0] == "") {
        rh[0] = sf;
        rh1 += 'a';
      } else if (sf == rh[0])
        rh1 += 'a';
      else if (sf != rh[0] && rh[1] == "") {
        rh[1] = sf;
        rh1 += 'b';
      } else if (sf == rh[1])
        rh1 += 'b';
      else {
        cout << "NO";
        return 0;
      }
    }
    if (!check(rh1)) {
      cout << "NO";
      return 0;
    }
    if (i == 0)
      common = rh1;
    else if (common == "aaaa")
      common = rh1;
    else if (common != rh1 && rh1 != "aaaa") {
      cout << "NO";
      return 0;
    }
  }
  cout << common;
  return 0;
}
