#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, z, k, sol, sum, ans, l, r, xx, yy, a[1000000], b[1000000];
vector<long long> v1;
vector<long long> v2;
pair<long long, pair<long long, long long> > pp[1000000];
pair<long long, long long> p[1000000];
map<long long, long long> ma;
string s1, s2, s3, s4, s11, s22, s33, s44;
char c;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> s1 >> s2 >> s3 >> s4;
    s11.clear();
    s22.clear();
    s33.clear();
    s44.clear();
    if (x == 1) continue;
    if (s1.size() < k || s2.size() < k || s3.size() < k || s4.size() < k) x = 1;
    m = k;
    while (m && s1.size()) {
      s11 += s1[s1.size() - 1];
      if (s1[s1.size() - 1] == 'a' || s1[s1.size() - 1] == 'e' ||
          s1[s1.size() - 1] == 'i' || s1[s1.size() - 1] == 'o' ||
          s1[s1.size() - 1] == 'u')
        m--;
      s1.pop_back();
    }
    if (m) x = 1;
    m = k;
    while (m && s2.size()) {
      s22 += s2[s2.size() - 1];
      if (s2[s2.size() - 1] == 'a' || s2[s2.size() - 1] == 'e' ||
          s2[s2.size() - 1] == 'i' || s2[s2.size() - 1] == 'o' ||
          s2[s2.size() - 1] == 'u')
        m--;
      s2.pop_back();
    }
    if (m) x = 1;
    m = k;
    while (m && s3.size()) {
      s33 += s3[s3.size() - 1];
      if (s3[s3.size() - 1] == 'a' || s3[s3.size() - 1] == 'e' ||
          s3[s3.size() - 1] == 'i' || s3[s3.size() - 1] == 'o' ||
          s3[s3.size() - 1] == 'u')
        m--;
      s3.pop_back();
    }
    if (m) x = 1;
    m = k;
    while (m && s4.size()) {
      s44 += s4[s4.size() - 1];
      if (s4[s4.size() - 1] == 'a' || s4[s4.size() - 1] == 'e' ||
          s4[s4.size() - 1] == 'i' || s4[s4.size() - 1] == 'o' ||
          s4[s4.size() - 1] == 'u')
        m--;
      s4.pop_back();
    }
    if (m) x = 1;
    m = k;
    if (s11 == s22 && s22 == s33 && s33 == s44)
      a[1] = 1;
    else if (s11 == s22 && s33 == s44)
      a[2] = 1;
    else if (s11 == s33 && s22 == s44) {
      a[3] = 1;
    } else if (s11 == s44 && s22 == s33)
      a[4] = 1;
    else
      x = 1;
  }
  if (a[2] + a[3] + a[4] > 1 || a[2] + a[3] + a[4] + a[1] == 0 || x) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 2; i <= 4; i++) {
    if (a[i] > 0 && i == 2) {
      cout << "aabb" << endl, y = 1;
    } else if (a[i] > 0 && i == 3)
      cout << "abab" << endl, y = 1;
    else if (a[i] > 0 && i == 4)
      cout << "abba" << endl, y = 1;
  }
  if (!y) cout << "aaaa" << endl;
  return 0;
}
