#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int ll_max = 1e6;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int i, j, m, k, x, y, z, n;
  cin >> n >> k;
  vector<char> vowels = {'a', 'e', 'i', 'o', 'u'};
  vector<string> rhyme = {"aaaa", "aabb", "abab", "abba"};
  long long int flag = 0;
  long long int ans = -1;
  for (long long int i = 0; i < n; i++) {
    string s1, s2, s3, s4;
    cin >> s1 >> s2 >> s3 >> s4;
    long long int cnt = 0, c = -1;
    for (long long int i = s1.length() - 1; i >= 0; i--) {
      for (auto u : vowels) {
        if (u == s1[i]) cnt++;
      }
      if (cnt == k) {
        c = i;
        break;
      }
    }
    if (cnt < k)
      flag = 1;
    else
      s1 = s1.substr(c, s1.length());
    cnt = 0, c = -1;
    for (long long int i = s2.length() - 1; i >= 0; i--) {
      for (auto u : vowels) {
        if (u == s2[i]) cnt++;
      }
      if (cnt == k) {
        c = i;
        break;
      }
    }
    if (cnt < k)
      flag = 1;
    else
      s2 = s2.substr(c, s2.length());
    cnt = 0, c = -1;
    for (long long int i = s3.length() - 1; i >= 0; i--) {
      for (auto u : vowels) {
        if (u == s3[i]) cnt++;
      }
      if (cnt == k) {
        c = i;
        break;
      }
    }
    if (cnt < k)
      flag = 1;
    else
      s3 = s3.substr(c, s3.length());
    cnt = 0;
    c = -1;
    for (long long int i = s4.length() - 1; i >= 0; i--) {
      for (auto u : vowels) {
        if (u == s4[i]) cnt++;
      }
      if (cnt == k) {
        c = i;
        break;
      }
    }
    if (cnt < k)
      flag = 1;
    else
      s4 = s4.substr(c, s4.length());
    long long int dum;
    if (s1 == s2 && s1 == s3 && s1 == s4) {
      dum = 0;
    } else if (s1 == s2 && s3 == s4) {
      dum = 1;
      if (ans == -1)
        ans = dum;
      else {
        if (dum != ans) flag = 1;
      }
    } else if (s1 == s3 && s2 == s4) {
      dum = 2;
      if (ans == -1)
        ans = dum;
      else {
        if (dum != ans) flag = 1;
      }
    } else if (s1 == s4 && s2 == s3) {
      dum = 3;
      if (ans == -1)
        ans = dum;
      else {
        if (dum != ans) flag = 1;
      }
    } else
      flag = 1;
  }
  if (flag == 1) {
    cout << "NO";
  } else {
    if (ans == -1) ans = 0;
    cout << rhyme[ans];
  }
  return 0;
}
