#include <bits/stdc++.h>
using namespace std;
struct stih {
  string s1, s2, s3, s4;
  int type;
};
int n, k;
stih dz[2500];
bool golosna(char c) {
  return ((c == 'a') || (c == 'e') || (c == 'i') || (c == 'o') || (c == 'u'));
}
bool ryma(string s1, string s2) {
  int K = k;
  int i1 = s1.size() - 1, i2 = s2.size() - 1;
  bool rez = true;
  while ((i1 >= 0) && (i2 >= 0) && (K) && rez) {
    if (s1[i1] == s2[i2]) {
      i1--;
      i2--;
      if (golosna(s1[i1 + 1])) {
        K--;
      }
    } else {
      rez = false;
    }
  }
  if (rez = false) {
    return false;
  }
  if (K == 0) {
    return true;
  }
  return false;
}
void getrymatype(int i) {
  bool rym[5][5];
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 5; j++) {
      rym[i][j] = false;
    }
  }
  if (ryma(dz[i].s1, dz[i].s2)) {
    rym[1][2] = true;
  }
  if (ryma(dz[i].s1, dz[i].s3)) {
    rym[1][3] = true;
  }
  if (ryma(dz[i].s1, dz[i].s4)) {
    rym[1][4] = true;
  }
  if (rym[1][2] && rym[1][3]) {
    rym[2][3] = true;
  } else {
    if (ryma(dz[i].s2, dz[i].s3)) {
      rym[2][3] = true;
    }
  }
  if (rym[1][3] && rym[1][4]) {
    rym[3][4] = true;
  } else {
    if (ryma(dz[i].s3, dz[i].s4)) {
      rym[3][4] = true;
    }
  }
  if (rym[1][2] && rym[1][4]) {
    rym[2][4] = true;
  } else {
    if (ryma(dz[i].s2, dz[i].s4)) {
      rym[2][4] = true;
    }
  }
  if (rym[1][2]) {
    if (rym[3][4]) {
      dz[i].type = 1;
    } else {
      dz[i].type = 0;
    }
  } else {
    if (rym[1][3] && rym[2][4]) {
      dz[i].type = 2;
    } else {
      if (rym[1][4] && rym[2][3]) {
        dz[i].type = 3;
      } else {
        dz[i].type = 0;
      }
    }
  }
  if (rym[1][2] && rym[2][3] && rym[3][4]) {
    dz[i].type = 4;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> dz[i].s1 >> dz[i].s2 >> dz[i].s3 >> dz[i].s4;
  }
  int rez = 4;
  for (int i = 0; i < n; i++) {
    getrymatype(i);
    if (dz[i].type != 4) {
      if (rez == 4) {
        rez = dz[i].type;
      } else {
        if (rez != dz[i].type) {
          cout << "NO" << endl;
          exit(0);
        }
      }
    }
  }
  if (rez == 0) {
    cout << "NO" << endl;
    exit(0);
  }
  if (rez == 1) {
    cout << "aabb" << endl;
    exit(0);
  }
  if (rez == 2) {
    cout << "abab" << endl;
    exit(0);
  }
  if (rez == 3) {
    cout << "abba" << endl;
    exit(0);
  }
  cout << "aaaa" << endl;
  return 0;
}
