#include <bits/stdc++.h>
using namespace std;
const int N = 20005;
int k;
bool judge(string a, string b) {
  int len1 = a.size();
  int len2 = b.size();
  int u1 = -1, u2 = -1;
  int count1 = 0;
  for (int i = len1 - 1; i >= 0; i--) {
    if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' ||
        a[i] == 'u') {
      count1++;
    }
    if (count1 == k) {
      u1 = i;
      break;
    }
  }
  count1 = 0;
  for (int i = len2 - 1; i >= 0; i--) {
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' ||
        b[i] == 'u') {
      count1++;
    }
    if (count1 == k) {
      u2 = i;
      break;
    }
  }
  if (u1 != -1 && u2 != -1 && len1 - u1 == len2 - u2) {
    for (int i = u1, j = u2; i < len1; i++, j++) {
      if (a[i] != b[j]) return false;
    }
    return true;
  }
  return false;
}
string str[5];
int n, p[5];
int ans[2501];
int main() {
  memset(p, 0, sizeof(p));
  memset(ans, -1, sizeof(ans));
  int t = 0;
  scanf("%d%d", &n, &k);
  for (int j = 0; j < n * 4; j++) {
    j = j % 4;
    cin >> str[j];
    if (j % 4 != 3) continue;
    int i = 0;
    if (judge(str[i], str[i + 1]) && judge(str[i + 2], str[i + 3])) {
      if (judge(str[i], str[i + 2])) {
        ans[t] = 1;
      } else {
        ans[t] = 2;
      }
    }
    if (judge(str[i], str[i + 2]) && judge(str[i + 1], str[i + 3])) {
      if (judge(str[i], str[i + 1])) {
        ans[t] = 1;
      } else {
        ans[t] = 3;
      }
    }
    if (judge(str[i], str[i + 3]) && judge(str[i + 2], str[i + 1])) {
      if (judge(str[i], str[i + 2])) {
        ans[t] = 1;
      } else {
        ans[t] = 4;
      }
    }
    t++;
    if (t == n) {
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    if (ans[i] == 1) {
      p[1] = 1;
    } else if (ans[i] == 2) {
      p[2] = 1;
    } else if (ans[i] == 3) {
      p[3] = 1;
    } else if (ans[i] == 4) {
      p[4] = 1;
    } else if (ans[i] == -1) {
      puts("NO");
      return 0;
    }
  }
  if (p[1] == 1) {
    if (p[2] + p[3] + p[4] > 1) {
      puts("NO");
    } else if (p[2] + p[3] + p[4] == 1) {
      if (p[2]) {
        puts("aabb");
      } else if (p[3]) {
        puts("abab");
      } else {
        puts("abba");
      }
    } else if (p[2] + p[3] + p[4] == 0) {
      puts("aaaa");
    }
  } else {
    if (p[2] + p[3] + p[4] >= 2 || p[2] + p[3] + p[4] == 0) {
      puts("NO");
    } else if (p[2]) {
      puts("aabb");
    } else if (p[3]) {
      puts("abab");
    } else {
      puts("abba");
    }
  }
  return 0;
}
