#include <bits/stdc++.h>
using namespace std;
int n, K;
bool isvowel(char ch) {
  return (ch == 'a' or ch == 'e' or ch == 'i' or ch == 'o' or ch == 'u');
}
string scheme(int i, int j) {
  if (i == 0 and j == 1) {
    return "aabb";
  }
  if (i == 0 and j == 2) {
    return "abab";
  }
  if (i == 0 and j == 3) {
    return "abba";
  }
  return "";
}
set<string> st;
bool find() {
  string s[4];
  vector<int> v[4];
  for (int i = 0; i < 4; i++) {
    cin >> s[i];
    for (int j = s[i].size() - 1; j >= 0; j--) {
      if (isvowel(s[i][j])) {
        v[i].push_back(j);
      }
    }
  }
  int cnt = 0;
  int c[3][4] = {{0, 1, 2, 3}, {0, 2, 1, 3}, {0, 3, 1, 2}};
  for (int p = 0; p < 3; p++) {
    int i = c[p][0], j = c[p][1], k = c[p][2], l = c[p][3];
    if (v[i].size() >= K and v[j].size() >= K and v[k].size() >= K and
        v[l].size() >= K) {
      string x = s[i].substr(v[i][K - 1]);
      string y = s[j].substr(v[j][K - 1]);
      string w = s[k].substr(v[k][K - 1]);
      string z = s[l].substr(v[l][K - 1]);
      if (x == y and w == z) {
        st.insert(scheme(i, j));
        cnt++;
      }
    } else {
      return false;
    }
  }
  if (cnt == 3) {
    st.insert("aaaa");
  }
  return true;
}
int main() {
  cin >> n >> K;
  set<string> last;
  for (int i = 0; i < n; i++) {
    if (find()) {
      if (i == 0) {
        for (auto it : st) {
          last.insert(it);
        }
      } else {
        set<string> t;
        for (auto it : last) {
          if (st.find(it) != st.end()) {
            t.insert(it);
          }
        }
        last.clear();
        for (auto it : t) {
          last.insert(it);
        }
      }
      st.clear();
    } else {
      cout << "NO";
      return 0;
    }
    if (last.size() == 0) {
      cout << "NO\n";
      return 0;
    }
  }
  if (last.size() > 0 and (*(last.begin()) == "aaaa" or (last.size() == 1))) {
    cout << *(last.begin());
  } else {
    cout << "NO\n";
  }
  return 0;
}
