#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, len, flag[2505], i, last, num;
  string s[5], match[5];
  scanf("%d%d", &N, &K);
  for (i = 1; i <= N; i++) {
    for (int j = 1; j <= 4; j++) {
      cin >> s[j];
      len = s[j].size();
      num = 0;
      for (last = len - 1; last >= 0; last--) {
        if (s[j][last] == 'a' || s[j][last] == 'e' || s[j][last] == 'i' ||
            s[j][last] == 'o' || s[j][last] == 'u')
          num++;
        if (num == K) break;
      }
      if (num != K) break;
      match[j] = s[j].substr(last, len);
    }
    if (num != K) break;
    if (match[1].compare(match[2]) == 0 && match[3].compare(match[4]) == 0 &&
        match[1].compare(match[3]) == 0)
      flag[i] = 0;
    else if (match[1].compare(match[2]) == 0 && match[3].compare(match[4]) == 0)
      flag[i] = 1;
    else if (match[1].compare(match[3]) == 0 && match[2].compare(match[4]) == 0)
      flag[i] = 2;
    else if (match[1].compare(match[4]) == 0 && match[3].compare(match[2]) == 0)
      flag[i] = 3;
    else
      break;
    if (i == 1) continue;
    if (flag[i] != flag[i - 1] && flag[i] != 0 && flag[i - 1] != 0) break;
    if (flag[i] == 0) flag[i] = flag[i - 1];
  }
  if (i != N + 1)
    cout << "NO" << endl;
  else if (flag[N] == 0)
    cout << "aaaa" << endl;
  else if (flag[N] == 1)
    cout << "aabb" << endl;
  else if (flag[N] == 2)
    cout << "abab" << endl;
  else if (flag[N] == 3)
    cout << "abba" << endl;
  return 0;
}
