#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1E-9;
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
int n, k;
bool check1(string a, string b, string c, string d) {
  string p, q, r, s;
  int t = 0;
  for (int i = a.size() - 1; i >= 0; i--) {
    if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u')
      t++;
    p = p + a[i];
    if (t == k) {
      break;
    }
  }
  if (t != k) return 0;
  t = 0;
  for (int i = b.size() - 1; i >= 0; i--) {
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' || b[i] == 'u')
      t++;
    q = q + b[i];
    if (t == k) {
      break;
    }
  }
  if (t != k) return 0;
  t = 0;
  for (int i = c.size() - 1; i >= 0; i--) {
    if (c[i] == 'a' || c[i] == 'e' || c[i] == 'i' || c[i] == 'o' || c[i] == 'u')
      t++;
    r = r + c[i];
    if (t == k) {
      break;
    }
  }
  if (t != k) return 0;
  t = 0;
  for (int i = d.size() - 1; i >= 0; i--) {
    if (d[i] == 'a' || d[i] == 'e' || d[i] == 'i' || d[i] == 'o' || d[i] == 'u')
      t++;
    s = s + d[i];
    if (t == k) {
      break;
    }
  }
  if (t != k) return 0;
  t = 0;
  if (p == q && q == r && r == s) return 1;
  return 0;
}
bool check(string a, string b) {
  string p, q;
  int t = 0;
  for (int i = a.size() - 1; i >= 0; i--) {
    if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u')
      t++;
    p = p + a[i];
    if (t == k) {
      break;
    }
  }
  if (t != k) return 0;
  t = 0;
  for (int i = b.size() - 1; i >= 0; i--) {
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' || b[i] == 'u')
      t++;
    q = q + b[i];
    if (t == k) {
      break;
    }
  }
  if (t != k) return 0;
  t = 0;
  if (p != q) return 0;
  return 1;
}
int main() {
  cin >> n >> k;
  string rhy = "aaaa";
  for (int i = 0; i < (int)(n); i++) {
    string ar[4];
    for (int j = 0; j < (int)(4); j++) {
      cin >> ar[j];
    }
    string temp;
    if (check1(ar[0], ar[1], ar[2], ar[3]))
      continue;
    else if (check(ar[0], ar[1]) && check(ar[2], ar[3]))
      temp = "aabb";
    else if (check(ar[0], ar[2]) && check(ar[1], ar[3]))
      temp = "abab";
    else if (check(ar[0], ar[3]) && check(ar[2], ar[1]))
      temp = "abba";
    if (temp.size() == 0) {
      cout << "NO";
      return 0;
    }
    if (rhy == "aaaa")
      rhy = temp;
    else if (rhy != temp) {
      cout << "NO";
      return 0;
    }
  }
  cout << rhy;
}
