#include <bits/stdc++.h>
using namespace std;
enum { AABB, ABAB, ABBA, AAAA };
int n, k;
string s1, s2, s3, s4;
bool isvow(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
string suf(string s) {
  static int sp = 0;
  auto i = s.end(), beg = s.begin();
  int tk = 0;
  while (tk < k && i > beg) {
    --i;
    tk += isvow(*i);
  }
  string res(i, s.end());
  if (tk < k) {
    res = string(sp++, ' ');
  }
  return res;
}
void foo() {
  cout << "NO\n";
  exit(0);
}
int main(void) {
  int i;
  cin >> n >> k;
  int ans = AAAA;
  for (i = 0; i < n; ++i) {
    cin >> s1 >> s2 >> s3 >> s4;
    auto suf1 = suf(s1), suf2 = suf(s2), suf3 = suf(s3), suf4 = suf(s4);
    if (suf1 == suf2 && suf2 == suf3 && suf3 == suf4) {
    } else if (suf1 == suf2 && suf3 == suf4) {
      if (ans == AAAA || ans == AABB) {
        ans = AABB;
      } else {
        foo();
      }
    } else if (suf1 == suf3 && suf2 == suf4) {
      if (ans == AAAA || ans == ABAB) {
        ans = ABAB;
      } else {
        foo();
      }
    } else if (suf1 == suf4 && suf2 == suf3) {
      if (ans == AAAA || ans == ABBA) {
        ans = ABBA;
      } else {
        foo();
      }
    } else {
      foo();
    }
  }
  switch (ans) {
    case AABB:
      cout << "aabb\n";
      break;
    case ABAB:
      cout << "abab\n";
      break;
    case ABBA:
      cout << "abba\n";
      break;
    case AAAA:
      cout << "aaaa\n";
      break;
    default:
      foo();
  }
  return 0;
}
