#include <bits/stdc++.h>
using namespace std;
const int N = 10005;
int n, k, i, j, p, h, st, qa, t, d[N], g[N][5][5], res[5][5];
char ch[N];
vector<char> a[N];
int main() {
  scanf("%d%d", &n, &k);
  for (i = 1; i <= 4 * n; ++i) {
    ch[0] = '\0';
    cin >> ch;
    p = strlen(ch);
    for (j = 0; j < p; ++j) {
      a[i].push_back(ch[j]);
    }
  }
  for (i = 1; i <= 4 * n; ++i) {
    qa = 0;
    for (j = a[i].size() - 1; j >= 0; --j) {
      if (a[i][j] == 'a' || a[i][j] == 'e' || a[i][j] == 'i' ||
          a[i][j] == 'o' || a[i][j] == 'u') {
        qa++;
        if (qa == k) {
          d[i] = j;
          break;
        }
      }
    }
    if (qa < k) {
      cout << "NO\n";
      return 0;
    }
  }
  for (i = 1; i <= 4 * n; i += 4) {
    for (j = i; j <= i + 3; ++j) {
      for (k = j + 1; k <= i + 3; ++k) {
        if (a[j].size() - d[j] == a[k].size() - d[k]) {
          st = 1;
          for (t = 0; t < a[j].size() - d[j]; ++t) {
            if (a[j][t + d[j]] != a[k][t + d[k]]) {
              st = 0;
              break;
            }
          }
          g[(i + 3) / 4][j - i][k - i] = st;
          g[(i + 3) / 4][k - i][j - i] = st;
        }
      }
    }
  }
  for (j = 0; j < 4; ++j) {
    for (k = 0; k < 4; ++k) {
      res[j][k] = 1;
    }
  }
  st = 0;
  for (i = 1; i <= n; i++) {
    qa = 0;
    for (j = 0; j < 4; ++j) {
      qa = qa + g[i][0][j];
    }
    if (qa != 3) {
      for (k = 0; k < 4; ++k) {
        qa = 0;
        for (j = 0; j < 4; ++j) {
          qa = qa + g[i][k][j];
        }
        if (qa != 1) {
          cout << "NO\n";
          return 0;
        }
      }
      if (st == 0) {
        st = 1;
        for (j = 0; j < 4; ++j) {
          for (k = 0; k < 4; ++k) {
            res[j][k] = g[i][j][k];
          }
        }
      }
      for (j = 0; j < 4; ++j) {
        for (k = 0; k < 4; ++k) {
          if (res[j][k] != g[i][j][k]) {
            cout << "NO" << endl;
            return 0;
          }
        }
      }
    }
  }
  if (st == 0) {
    cout << "aaaa\n";
    return 0;
  }
  for (i = 1; i < 4; ++i) {
    if (res[0][i] == 1) {
      h = i;
    }
  }
  cout << "a";
  for (i = 1; i < 4; ++i) {
    if (i != h) {
      cout << "b";
    } else
      cout << "a";
  }
  cout << endl;
  return 0;
}
