#include <bits/stdc++.h>
using namespace std;
vector<vector<string> > v;
int mat[2509][4];
int vowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') return 1;
  return 0;
}
int main() {
  int n, k;
  string s;
  int ans1 = 1, ans2 = 1, ans3 = 1, ans4 = 1;
  cin >> n >> k;
  int i;
  int x, y;
  for (x = 0; x < n; x++) {
    vector<string> z;
    for (y = 0; y < 4; y++) {
      cin >> s;
      int len = s.length();
      int cnt = 0;
      for (i = len - 1; i >= 0; i--) {
        if (vowel(s[i])) cnt++;
        if (cnt == k) break;
      }
      if (cnt < k) {
        cout << "NO\n";
        return 0;
      }
      z.push_back(s.substr(i, len - 1 - i + 1));
    }
    if (z[0] == z[1] && z[2] == z[3]) mat[x][0] = 1;
    if (z[0] == z[2] && z[1] == z[3]) mat[x][1] = 1;
    if (z[0] == z[3] && z[1] == z[2]) mat[x][2] = 1;
    if (z[0] == z[1] && z[1] == z[2] && z[2] == z[3]) mat[x][3] = 1;
    ans1 = (ans1 & mat[x][0]);
    ans2 = (ans2 & mat[x][1]);
    ans3 = (ans3 & mat[x][2]);
    ans4 = (ans4 & mat[x][3]);
  }
  if (ans4 == 1)
    cout << "aaaa\n";
  else if (ans1 == 1)
    cout << "aabb\n";
  else if (ans2 == 1)
    cout << "abab\n";
  else if (ans3 == 1)
    cout << "abba\n";
  else
    cout << "NO";
  return 0;
}
