#include <bits/stdc++.h>
using namespace std;
long mod(long int a) { return (a > 0 ? a : (-a)); }
long min(long int a, long int b) { return (a) > (b) ? (b) : (a); }
long max(long int a, long int b) { return (a) < (b) ? (b) : (a); }
bool sortbyff(const pair<int, int>& a, const pair<int, int>& b) {
  return (a.first < b.first);
}
bool vow(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
void rh(vector<vector<string>>& v, std::vector<long>& ret, long n, long k) {
  bool arr[4][4] = {};
  long a[4];
  a[0] = v[n][0].length(), a[1] = v[n][1].length(), a[2] = v[n][2].length(),
  a[3] = v[n][3].length();
  while (k--) {
    a[0]--, a[1]--, a[2]--, a[3]--;
    while (!vow(v[n][0][a[0]])) {
      a[0]--;
      if (a[0] < 0) {
        cout << "NO";
        exit(0);
      };
    }
    while (!vow(v[n][1][a[1]])) {
      a[1]--;
      if (a[1] < 0) {
        cout << "NO";
        exit(0);
      };
    }
    while (!vow(v[n][2][a[2]])) {
      a[2]--;
      if (a[2] < 0) {
        cout << "NO";
        exit(0);
      };
    }
    while (!vow(v[n][3][a[3]])) {
      a[3]--;
      if (a[3] < 0) {
        cout << "NO";
        exit(0);
      };
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = i + 1; j < 4; j++) {
      if (v[n][i].length() - a[i] == v[n][j].length() - a[j]) {
        long flag = 0;
        for (int x = a[i], y = a[j];
             x < v[n][i].length() && y < v[n][j].length(); x++, y++) {
          if (v[n][i][x] != v[n][j][y]) {
            flag = 1;
            break;
          }
        }
        if (!flag) arr[i][j] = true;
      }
    }
  }
  if (arr[0][1] && arr[2][3]) {
    if (arr[1][2])
      ret[n] = 0;
    else
      ret[n] = 1;
  } else if (arr[0][2] && arr[1][3]) {
    if (arr[1][2])
      ret[n] = 0;
    else
      ret[n] = 2;
  } else if (arr[0][3] && arr[1][2]) {
    if (arr[0][1])
      ret[n] = 0;
    else
      ret[n] = 3;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long n, m, k, i, j, l, r, b, c, d, t, u, w, z, sum = 0, p = 0, ans = -1;
  cin >> n >> k;
  vector<vector<string>> v(n);
  std::vector<long> ret(n, -1);
  string s;
  for (i = 0; i < n; i++) {
    for (j = 1; j <= 4; j++) {
      cin >> s;
      v[i].push_back(s);
    }
    rh(v, ret, i, k);
  }
  for (i = 0; i < n; i++) {
    if (ret[i] < 0) {
      cout << "NO";
      exit(0);
    }
    ans = max(ans, ret[i]);
  }
  if (!ans) {
    cout << "aaaa";
    exit(0);
  } else {
    for (i = 0; i < n; i++) {
      if (ret[i] && ret[i] != ans) {
        cout << "NO";
        exit(0);
      }
    }
  }
  ans == 1   ? cout << "aabb"
  : ans == 2 ? cout << "abab"
  : ans == 3 ? cout << "abba"
             : cout << "NO";
  return 0;
}
