#include <bits/stdc++.h>
using namespace std;
int a[5000];
int k;
int no = 0;
string last(string s) {
  int w = 0;
  int i = (int)s.size() - 1;
  while (i >= 0 && w != k) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
        s[i] == 'u') {
      w++;
    }
    i--;
  }
  string res;
  if (w == k) {
    i++;
  } else {
    no = 1;
  }
  for (i; i < (int)s.size(); i++) {
    res += s[i];
  }
  return res;
}
int main() {
  int n;
  cin >> n >> k;
  string s1, s2, s3, s4;
  string p1, p2, p3, p4;
  for (int i = 0; i < n; i++) {
    cin >> s1 >> s2 >> s3 >> s4;
    p1 = last(s1);
    p2 = last(s2);
    p3 = last(s3);
    p4 = last(s4);
    if (p1 == p2 && p2 == p3 && p3 == p4 && no == 0) {
      a[i] = 0;
    } else if (p1 == p2 && p3 == p4 && no == 0) {
      a[i] = 2;
    } else if (p1 == p3 && p2 == p4 && no == 0) {
      a[i] = 3;
    } else if (p1 == p4 && p2 == p3 && no == 0) {
      a[i] = 5;
    } else {
      a[i] = 7;
    }
  }
  int r = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) {
      r = 1;
    }
  }
  if (r == 0) {
    cout << "aaaa" << endl;
    return 0;
  }
  r = 0;
  for (int i = 0; i < n; i++) {
    if (!(a[i] == 2 || a[i] == 0)) {
      r = 1;
    }
  }
  if (r == 0) {
    cout << "aabb" << endl;
    return 0;
  }
  r = 0;
  for (int i = 0; i < n; i++) {
    if (!(a[i] == 3 || a[i] == 0)) {
      r = 1;
    }
  }
  if (r == 0) {
    cout << "abab" << endl;
    return 0;
  }
  r = 0;
  for (int i = 0; i < n; i++) {
    if (!(a[i] == 5 || a[i] == 0)) {
      r = 1;
    }
  }
  if (r == 0) {
    cout << "abba" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
