#include <bits/stdc++.h>
using namespace std;
bool is_vowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
    return true;
  }
  return false;
}
bool is_rhyme(string s1, string s2, int k) {
  int i, p1 = 0, p2 = 0, l1, l2;
  for (i = s1.size() - 1, p1 = 0; i >= 0 && p1 < k; i--) {
    if (is_vowel(s1[i])) {
      p1++;
    }
  }
  l1 = i + 1;
  if (p1 != k) {
    return false;
  }
  for (i = s2.size() - 1, p2 = 0; i >= 0 && p2 < k; i--) {
    if (is_vowel(s2[i])) {
      p2++;
    }
  }
  if (p2 != k) {
    return false;
  }
  l2 = i + 1;
  if (s1.substr(l1, s1.size() - l1 + 1) == s2.substr(l2, s2.size() - l2 + 1)) {
    return true;
  }
  return false;
}
int main() {
  long long int i, j, k, m, n, t, x, y, z;
  string rhyme[3000];
  string str[3000][5];
  char ch;
  string s1, s2, s3;
  vector<int> v;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 4; j++) {
      cin >> str[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    bool fir =
        is_rhyme(str[i][0], str[i][1], k) && is_rhyme(str[i][2], str[i][3], k);
    bool sec =
        is_rhyme(str[i][0], str[i][2], k) && is_rhyme(str[i][1], str[i][3], k);
    bool thr =
        is_rhyme(str[i][0], str[i][3], k) && is_rhyme(str[i][1], str[i][2], k);
    if (fir && sec && thr) {
      rhyme[i] = "4";
    } else if (fir && sec) {
      rhyme[i] = "12";
    } else if (fir && thr) {
      rhyme[i] = "13";
    } else if (thr && sec) {
      rhyme[i] = "23";
    } else if (fir) {
      rhyme[i] = "1";
    } else if (sec) {
      rhyme[i] = "2";
    } else if (thr) {
      rhyme[i] = "3";
    } else {
      rhyme[i] = "0";
    }
  }
  int ct = 1;
  char ans = '0';
  for (char k = '4'; k >= '1'; k--) {
    ct = 1;
    for (i = 0; i < n; i++) {
      int tmp = 1;
      for (j = 0; j < rhyme[i].size(); j++) {
        if (rhyme[i][j] == k || rhyme[i] == "4") {
          tmp = 0;
        }
      }
      if (tmp == 1) {
        ct = 0;
        break;
      }
    }
    if (ct == 1) {
      ans = k;
      break;
    }
  }
  if (ans == '4') {
    cout << "aaaa";
  } else if (ans == '1') {
    cout << "aabb";
  } else if (ans == '2') {
    cout << "abab";
  } else if (ans == '3') {
    cout << "abba";
  } else {
    cout << "NO";
  }
  return 0;
}
