#include <bits/stdc++.h>
using namespace std;
int all_same(int* start, int* end) {
  int g = *start;
  start++;
  while (start != end) {
    if (g != (*start)) {
      if (g == 1)
        g = *start;
      else if ((*start) != 1)
        return 0;
    }
    start++;
  }
  return g;
}
int main() {
  int n, k;
  cin >> n >> k;
  int fourm[n];
  fill(fourm, fourm + n, -1);
  for (int i = 0; i < n; ++i) {
    vector<char> lines[4];
    bool all = true;
    for (int j = 0; j < 4; ++j) {
      string line;
      cin >> line;
      int vcount = 0;
      for (string::reverse_iterator it = line.rbegin(); it != line.rend();
           ++it) {
        lines[j].push_back(*it);
        char x = *it;
        if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') vcount++;
        if (vcount == k) break;
      }
      if (vcount < k) all = false;
    }
    if (all) {
      bool match[4][4];
      for (int i = 0; i < 4; ++i)
        for (int j = 0; j < 4; ++j)
          if (i < j)
            match[i][j] =
                (lines[i].size() == lines[j].size()) &&
                (equal(lines[i].begin(), lines[i].end(), lines[j].begin()));
      if (match[0][1] && match[0][2] && match[0][3] && match[1][2] &&
          match[1][3] && match[2][3])
        fourm[i] = 1;
      else if (match[0][1] && match[2][3])
        fourm[i] = 2;
      else if (match[0][2] && match[1][3])
        fourm[i] = 3;
      else if (match[0][3] && match[1][2])
        fourm[i] = 4;
      else
        fourm[i] = 0;
    } else
      fourm[i] = 0;
  }
  fourm[0] = all_same(fourm, fourm + n);
  if (fourm[0] == 0)
    cout << "NO" << endl;
  else if (fourm[0] == 1)
    cout << "aaaa" << endl;
  else if (fourm[0] == 2)
    cout << "aabb" << endl;
  else if (fourm[0] == 3)
    cout << "abab" << endl;
  else if (fourm[0] == 4)
    cout << "abba" << endl;
}
