#include <bits/stdc++.h>
using namespace std;
bool is_vow(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
int find_scheme(vector<string> q, int k) {
  int i, j;
  vector<string> ends;
  string temp;
  int cnt;
  for (i = 0; i < q.size(); ++i) {
    cnt = 0;
    for (j = q[i].size() - 1; j >= 0; --j) {
      if (is_vow(q[i][j])) cnt++;
      if (cnt == k) break;
    }
    if (cnt == k) {
      temp.clear();
      for (j; j < q[i].size(); ++j) temp += q[i][j];
      ends.push_back(temp);
    } else {
      return 0;
    }
  }
  if (!ends[0].compare(ends[1]) && !ends[2].compare(ends[3]) &&
      !ends[0].compare(ends[2]))
    return 4;
  else if (!ends[0].compare(ends[3]) && !ends[1].compare(ends[2]))
    return 3;
  else if (!ends[0].compare(ends[2]) && !ends[1].compare(ends[3]))
    return 2;
  else if (!ends[1].compare(ends[0]) && !ends[2].compare(ends[3]))
    return 1;
  else
    return 0;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<string> poem;
  int i;
  string temp;
  for (i = 0; i < n * 4; ++i) {
    cin >> temp;
    poem.push_back(temp);
  }
  vector<int> scheme;
  vector<string> tp;
  for (i = 0; i < n; ++i) {
    tp.clear();
    tp.push_back(poem[i * 4 + 0]);
    tp.push_back(poem[i * 4 + 1]);
    tp.push_back(poem[i * 4 + 2]);
    tp.push_back(poem[i * 4 + 3]);
    int j = find_scheme(tp, k);
    if (j == 0) {
      printf("NO\n");
      return 0;
    } else if (j == -1) {
      return 0;
    }
    scheme.push_back(j);
  }
  int ans = 4;
  for (i = 0; i < scheme.size(); ++i) {
    if (scheme[i] != 4) {
      ans = scheme[i];
      break;
    }
  }
  for (i = 1; i < scheme.size(); ++i) {
    if (!(scheme[i] == ans || scheme[i] == 4)) {
      printf("NO\n");
      return 0;
    }
  }
  if (ans == 1)
    printf("aabb\n");
  else if (ans == 2)
    printf("abab\n");
  else if (ans == 3)
    printf("abba\n");
  else if (ans == 4)
    printf("aaaa\n");
  return 0;
}
