#include <bits/stdc++.h>
using namespace std;
int n, K;
string s[4];
int gao() {
  for (int i = 0; i < 4; ++i) {
    cin >> s[i];
    int pos = -1;
    for (int j = (int)s[i].length() - 1, c = 0; j >= 0; --j) {
      if (s[i][j] == 'a' || s[i][j] == 'e' || s[i][j] == 'i' ||
          s[i][j] == 'o' || s[i][j] == 'u') {
        if (++c == K) {
          pos = j;
          break;
        }
      }
    }
    if (pos == -1) {
      return 0;
    }
    s[i] = s[i].substr(pos);
  }
  if (s[0] == s[1] && s[1] == s[2] && s[2] == s[3]) {
    return 0xF;
  }
  if (s[0] == s[1] && s[2] == s[3]) {
    return 1 << 0;
  }
  if (s[0] == s[2] && s[1] == s[3]) {
    return 1 << 1;
  }
  if (s[0] == s[3] && s[1] == s[2]) {
    return 1 << 2;
  }
  return 0;
}
int main() {
  cin >> n >> K;
  int res = 0xF;
  for (int i = 0; i < n; ++i) {
    int cur = gao();
    res &= cur;
  }
  if (res == 0) {
    puts("NO");
  } else if (res == 0xF) {
    puts("aaaa");
  } else if (res == 1) {
    puts("aabb");
  } else if (res == 2) {
    puts("abab");
  } else if (res == 4) {
    puts("abba");
  }
  return 0;
}
