#include <bits/stdc++.h>
using namespace std;
int n, m;
char poem[4][10005];
bool is[4][4];
int len[4];
char ans[5][10] = {"aaaa", "aabb", "abab", "abba", "NO"};
int vol(char x) {
  if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') return true;
  return false;
}
int type[2505];
int main(int argc, char** argv) {
  scanf("%d%d", &n, &m);
  for (int v = 0; v < n; ++v) {
    memset(is, false, sizeof(is));
    for (int i = 0; i < 4; ++i) scanf("%s", poem[i]);
    for (int i = 0; i < 4; ++i) len[i] = strlen(poem[i]);
    for (int i = 0; i < 4; ++i) {
      for (int j = 0; j < 4; ++j) {
        if (j == i) continue;
        bool flag = true;
        int cnt = 0;
        for (int k = len[i], l = len[j]; k >= 0 && j >= 0; --k, --l) {
          if (poem[i][k] != poem[j][l]) {
            flag = false;
            break;
          }
          if (vol(poem[i][k])) cnt++;
          if (cnt == m) break;
        }
        is[i][j] = (flag && (cnt == m));
      }
    }
    if (is[0][1] && is[0][2] && is[0][3]) {
      type[v] = 0;
      continue;
    }
    if (is[0][1] && is[2][3]) {
      type[v] = 1;
      continue;
    }
    if (is[0][2] && is[1][3]) {
      type[v] = 2;
      continue;
    }
    if (is[0][3] && is[1][2]) {
      type[v] = 3;
      continue;
    }
    type[v] = 4;
  }
  int con[5];
  memset(con, 0, sizeof(con));
  for (int i = 0; i < n; ++i) {
    con[type[i]]++;
  }
  if (con[0] > 0 && con[1] == 0 && con[2] == 0 && con[3] == 0 && con[4] == 0)
    puts(ans[0]);
  else if (con[1] > 0 && con[2] == 0 && con[3] == 0 && con[4] == 0)
    puts(ans[1]);
  else if (con[1] == 0 && con[2] > 0 && con[3] == 0 && con[4] == 0)
    puts(ans[2]);
  else if (con[1] == 0 && con[2] == 0 && con[3] > 0 && con[4] == 0)
    puts(ans[3]);
  else
    puts(ans[4]);
  return 0;
}
