#include <bits/stdc++.h>
using namespace std;
string lines[10000];
int scheme[4];
int quart = -1;
bool is_vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
bool rhyme(int s, int a, int b) {
  int A = lines[s + a].length() - scheme[a];
  int B = lines[s + b].length() - scheme[b];
  if (A != B) {
    return false;
  }
  return lines[s + a].substr(scheme[a]) == lines[s + b].substr(scheme[b]);
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < 4 * n; i++) {
    cin >> lines[i];
  }
  for (int i = 0; i < n; i++) {
    int s = i * 4;
    for (int x = 0; x < 4; x++) {
      scheme[x] = -1;
      int v = 0;
      for (int j = lines[s + x].length() - 1; j >= 0; j--) {
        if (is_vowel(lines[s + x][j])) {
          v++;
          if (v == k) {
            scheme[x] = j;
            break;
          }
        }
      }
      if (scheme[x] == -1) {
        cout << "NO" << endl;
        return 0;
      }
    }
    bool ab = rhyme(s, 0, 1);
    bool ac = rhyme(s, 0, 2);
    bool ad = rhyme(s, 0, 3);
    bool bc = rhyme(s, 1, 2);
    bool bd = rhyme(s, 1, 3);
    bool cd = rhyme(s, 2, 3);
    int nq;
    if (ab && bc && cd) {
      nq = 0;
    } else if (ab && cd) {
      nq = 1;
    } else if (ac && bd) {
      nq = 2;
    } else if (ad && bc) {
      nq = 3;
    } else {
      cout << "NO" << endl;
      return 0;
    }
    if (quart == -1 || quart == 0) {
      quart = nq;
    } else if (nq == 0 || nq == quart) {
      continue;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (quart == 0) {
    cout << "aaaa" << endl;
  } else if (quart == 1) {
    cout << "aabb" << endl;
  } else if (quart == 2) {
    cout << "abab" << endl;
  } else if (quart == 3) {
    cout << "abba" << endl;
  }
  return 0;
}
