#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 7;
char str[maxn];
char ans[4];
int main() {
  int n, k;
  cin >> n >> k;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    map<string, int> mp;
    string s[4];
    char tans[4];
    tans[0] = 1;
    int c = 0;
    for (int j = 0; j < 4; j++) {
      cin >> str;
      s[j].clear();
      int len = strlen(str);
      int kk = k;
      for (int i = len - 1; kk && len >= 0;) {
        s[j] += str[len];
        if (str[len] == 'a' || str[len] == 'e' || str[len] == 'i' ||
            str[len] == 'o' || str[len] == 'u')
          kk--;
        len--;
      }
      if (kk > 0 && len < 0) flag = 1;
      mp[s[j]] = j;
    }
    if (mp.size() <= 2) {
      for (int i = 1; i < 4; i++)
        if (mp[s[0]] == mp[s[i]])
          tans[i] = 0;
        else
          tans[i] = 1;
      for (int i = 1; i < 4; i++) {
        ans[i] = ans[i] | tans[i];
      }
    } else {
      flag = 1;
    }
  }
  if (flag == 0) {
    int cnt = 0;
    for (int i = 0; i < 4; i++) cnt += ans[i];
    if (cnt == 1 || cnt == 3) {
      cout << "NO" << endl;
    } else {
      for (int i = 0; i < 4; i++) {
        if (ans[i] == 0)
          cout << "a";
        else
          cout << "b";
      }
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
