#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ct, pos, k;
  string s1, s2, s3, s4, resp = "aaaa";
  bool enc = 1;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    cin >> s1 >> s2 >> s3 >> s4;
    ct = 0, pos;
    for (int i = s1.length() - 1; i >= 0; i--) {
      if (s1[i] == 'a' || s1[i] == 'e' || s1[i] == 'i' || s1[i] == 'o' ||
          s1[i] == 'u')
        ct++;
      if (ct == k) {
        pos = i;
        break;
      }
    }
    if (ct < k) {
      cout << "NO" << endl;
      enc = 0;
      break;
    }
    string sub1 = s1.substr(pos);
    ct = 0, pos;
    for (int i = s2.length() - 1; i >= 0; i--) {
      if (s2[i] == 'a' || s2[i] == 'e' || s2[i] == 'i' || s2[i] == 'o' ||
          s2[i] == 'u')
        ct++;
      if (ct == k) {
        pos = i;
        break;
      }
    }
    if (ct < k) {
      cout << "NO" << endl;
      enc = 0;
      break;
    }
    string sub2 = s2.substr(pos);
    ct = 0, pos;
    for (int i = s3.length() - 1; i >= 0; i--) {
      if (s3[i] == 'a' || s3[i] == 'e' || s3[i] == 'i' || s3[i] == 'o' ||
          s3[i] == 'u')
        ct++;
      if (ct == k) {
        pos = i;
        break;
      }
    }
    if (ct < k) {
      cout << "NO" << endl;
      enc = 0;
      break;
    }
    string sub3 = s3.substr(pos);
    ct = 0, pos;
    for (int i = s4.length() - 1; i >= 0; i--) {
      if (s4[i] == 'a' || s4[i] == 'e' || s4[i] == 'i' || s4[i] == 'o' ||
          s4[i] == 'u')
        ct++;
      if (ct == k) {
        pos = i;
        break;
      }
    }
    if (ct < k) {
      cout << "NO" << endl;
      enc = 0;
      break;
    }
    string sub4 = s4.substr(pos);
    string tipo = "nada";
    if (sub1 == sub2 && sub2 == sub3 && sub3 == sub4) {
      tipo = "aaaa";
    } else {
      if (sub1 == sub2 && sub3 == sub4) {
        tipo = "aabb";
      } else {
        if (sub1 == sub3 && sub2 == sub4) {
          tipo = "abab";
        } else {
          if (sub1 == sub4 && sub2 == sub3) {
            tipo = "abba";
          }
        }
      }
    }
    if (tipo == "nada") {
      cout << "NO" << endl;
      enc = 0;
      break;
    }
    if (tipo == "aaaa") continue;
    if (resp == "aaaa") {
      resp = tipo;
      continue;
    }
    if (tipo != resp) {
      cout << "NO" << endl;
      enc = 0;
      break;
    }
  }
  if (enc) cout << resp << endl;
}
