#include <bits/stdc++.h>
using namespace std;
char lines[4][10010], buf[10010];
bool vowel[128];
int n, k;
int getRhyme() {
  if (!strcmp(lines[0], lines[1])) {
    if (!strcmp(lines[2], lines[3])) {
      if (strcmp(lines[1], lines[2])) {
        return 2;
      } else {
        return 1;
      }
    }
    return 0;
  } else {
    if (!strcmp(lines[0], lines[2]) && !strcmp(lines[1], lines[3])) {
      return 3;
    }
    if (!strcmp(lines[0], lines[3]) && !strcmp(lines[1], lines[2])) {
      return 4;
    }
    return 0;
  }
  return 0;
}
int main() {
  fscanf(stdin, "%d %d\n", &n, &k);
  vowel['a'] = vowel['e'] = vowel['i'] = vowel['o'] = vowel['u'] = true;
  int rhymes = 1;
  for (int i = 0; i < n && rhymes; ++i) {
    for (int j = 0; j < 4; ++j) {
      fgets(buf, 10010, stdin);
      int len = strlen(buf);
      int toFind = k, pos = len - 2;
      while (toFind > 0 && pos >= 0) {
        if (vowel[buf[pos]]) {
          toFind--;
        }
        if (toFind > 0) {
          pos--;
        }
      }
      if (toFind > 0) {
        rhymes = 0;
        break;
      }
      memcpy(lines[j], buf + pos, len - pos - 1);
    }
    int newRhyme = getRhyme();
    if (newRhyme == 0) {
      rhymes = 0;
      break;
    }
    if (newRhyme == 1) {
      continue;
    }
    if (rhymes == 1) {
      rhymes = newRhyme;
    }
    if (rhymes != newRhyme) {
      rhymes = 0;
      break;
    }
  }
  switch (rhymes) {
    case 1:
      cout << "aaaa" << endl;
      break;
    case 2:
      cout << "aabb" << endl;
      break;
    case 3:
      cout << "abab" << endl;
      break;
    case 4:
      cout << "abba" << endl;
      break;
    case 0:
    default:
      cout << "NO" << endl;
      break;
  }
}
