#include <bits/stdc++.h>
using namespace std;
int n, k, aaaa, abab, aabb, abba, flag1, v;
string s[5], s1[5];
int main() {
  cin >> n >> k;
  aabb = 1;
  abab = 1;
  abba = 1;
  aaaa = 1;
  flag1 = 1;
  for (int q = 1; q <= n; q++) {
    for (int i = 1; i <= 4; i++) cin >> s[i];
    if (flag1 == 0) continue;
    for (int i = 1; i <= 4; i++) {
      v = 0;
      for (int j = ((s[i]).length()) - 1; j >= 0; j--) {
        if ((s[i][j] == 'a') or (s[i][j] == 'e') or (s[i][j] == 'i') or
            (s[i][j] == 'o') or (s[i][j] == 'u'))
          v++;
        if (v == k) {
          s1[i] = s[i].substr(j, (s[i].length() - j));
          break;
        }
      }
      if (v != k) {
        aabb = 0;
        abab = 0;
        abba = 0;
        aaaa = 0;
        flag1 = 0;
        break;
      }
    }
    if (flag1 == 0) continue;
    if (s1[1] != s1[2]) {
      aabb = 0;
      aaaa = 0;
    }
    if (s1[1] != s1[3]) {
      abab = 0;
      aaaa = 0;
    }
    if (s1[1] != s1[4]) {
      abba = 0;
      aaaa = 0;
    }
    if (s1[2] != s1[3]) {
      abba = 0;
      aaaa = 0;
    }
    if (s1[2] != s1[4]) {
      abab = 0;
      aaaa = 0;
    }
    if (s1[3] != s1[4]) {
      aabb = 0;
      aaaa = 0;
    }
  }
  if (aaaa == 1)
    cout << "aaaa" << endl;
  else if (aabb == 1)
    cout << "aabb" << endl;
  else if (abab == 1)
    cout << "abab" << endl;
  else if (abba == 1)
    cout << "abba" << endl;
  else
    cout << "NO" << endl;
}
