#include <bits/stdc++.h>
using namespace std;
bool vowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
    return 1;
  else
    return 0;
}
int calc(string &a, string &b, string &c, string &d, int k) {
  int cnt = 0, val = 0, ind = a.size() - 1;
  for (string::reverse_iterator it = a.rbegin(); it != a.rend(); it++) {
    if (vowel(*it)) {
      cnt++;
    }
    if (cnt == k) {
      val = 1;
      a = a.substr(ind, 10101);
      break;
    }
    ind--;
  }
  if (val == 0) return 0;
  cnt = 0, val = 0, ind = d.size() - 1;
  for (string::reverse_iterator it = d.rbegin(); it != d.rend(); it++) {
    if (vowel(*it)) {
      cnt++;
    }
    if (cnt == k) {
      val = 1;
      d = d.substr(ind, 10101);
      break;
    }
    ind--;
  }
  if (val == 0) return 0;
  cnt = 0, val = 0, ind = b.size() - 1;
  for (string::reverse_iterator it = b.rbegin(); it != b.rend(); it++) {
    if (vowel(*it)) {
      cnt++;
    }
    if (cnt == k) {
      val = 1;
      b = b.substr(ind, 10101);
      break;
    }
    ind--;
  }
  if (val == 0) return 0;
  cnt = 0, val = 0, ind = c.size() - 1;
  for (string::reverse_iterator it = c.rbegin(); it != c.rend(); it++) {
    if (vowel(*it)) {
      cnt++;
    }
    if (cnt == k) {
      val = 1;
      c = c.substr(ind, 10101);
      break;
    }
    ind--;
  }
  if (val == 0) return 0;
  if (a.compare(b) == 0 && c.compare(d) == 0) {
    if (b.compare(c) == 0)
      return 4;
    else
      return 1;
  } else if (a.compare(c) == 0 && b.compare(d) == 0)
    return 2;
  else if (a.compare(d) == 0 && b.compare(c) == 0)
    return 3;
  else
    return 0;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> ans(n, 0);
  string a, b, c, d;
  int val = 1;
  for (int i = (0); i <= (n - 1); i++) {
    cin >> a >> b >> c >> d;
    ans[i] = calc(a, b, c, d, k);
    if (ans[i] == 0) val = 0;
  }
  if (!val) {
    cout << "NO";
    return 0;
  }
  int sol[5] = {0};
  for (int i = (0); i <= (n - 1); i++) {
    sol[ans[i]] = 1;
  }
  int cnt = 0;
  if (sol[1]) cnt++;
  if (sol[2]) cnt++;
  if (sol[3]) cnt++;
  if (sol[4]) cnt++;
  if (cnt > 2)
    cout << "NO";
  else if (cnt == 1) {
    if (sol[1])
      cout << "aabb";
    else if (sol[2])
      cout << "abab";
    else if (sol[3])
      cout << "abba";
    else if (sol[4])
      cout << "aaaa";
  } else if (sol[4]) {
    if (sol[1])
      cout << "aabb";
    else if (sol[2])
      cout << "abab";
    else if (sol[3])
      cout << "abba";
    else if (sol[4])
      cout << "aaaa";
  } else
    cout << "NO";
  cout << endl;
  return 0;
}
