#include <bits/stdc++.h>
using namespace std;
bool vwl(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}
string cnst(string a, string b, string c, string d) {
  if (a == b && b == c && c == d) return "aaaa";
  if (a == b && c == d && b != c) return "aabb";
  if (b == c && a == d && b != a) return "abba";
  if (a == c && b == d && a != b) return "abab";
  return "NO";
}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<string> v(4 * n);
  for (auto &x : v) cin >> x;
  string p1, p2, p3, p4;
  p1 = p2 = p3 = p4 = "b";
  int ln = v[0].size(), now = 0;
  for (int i = ln - 1; i >= 0; i--) {
    if (vwl(v[0][i])) now++;
    if (now == k) {
      p1 = v[0].substr(i);
      break;
    }
  }
  if (p1 == "b" || now < k) {
    cout << "NO\n";
    return;
  }
  ln = v[1].size(), now = 0;
  for (int i = ln - 1; i >= 0; i--) {
    if (vwl(v[1][i])) now++;
    if (now == k) {
      p2 = v[1].substr(i);
      break;
    }
  }
  if (p2 == "b" || now < k) {
    cout << "NO\n";
    return;
  }
  ln = v[2].size(), now = 0;
  for (int i = ln - 1; i >= 0; i--) {
    if (vwl(v[2][i])) now++;
    if (now == k) {
      p3 = v[2].substr(i);
      break;
    }
  }
  if (p3 == "b" || now < k) {
    cout << "NO\n";
    return;
  }
  ln = v[3].size(), now = 0;
  for (int i = ln - 1; i >= 0; i--) {
    if (vwl(v[3][i])) now++;
    if (now == k) {
      p4 = v[3].substr(i);
      break;
    }
  }
  if (p4 == "b" || now < k) {
    cout << "NO\n";
    return;
  }
  string res = cnst(p1, p2, p3, p4);
  if (res == "NO") {
    cout << res + '\n';
    return;
  }
  for (int i = 4; i < 4 * n; i += 4) {
    string s1, s2, s3, s4;
    s1 = s2 = s3 = s4 = "b";
    now = 0, ln = v[i].size();
    for (int j = ln - 1; j >= 0; j--) {
      if (vwl(v[i][j])) now++;
      if (now == k) {
        s1 = v[i].substr(j);
        break;
      }
    }
    if (s1 == "b" || now < k) {
      cout << "NO\n";
      return;
    }
    now = 0, ln = v[i + 1].size();
    for (int j = ln - 1; j >= 0; j--) {
      if (vwl(v[i + 1][j])) now++;
      if (now == k) {
        s2 = v[i + 1].substr(j);
        break;
      }
    }
    if (s2 == "b" || now < k) {
      cout << "NO\n";
      return;
    }
    now = 0, ln = v[i + 2].size();
    for (int j = ln - 1; j >= 0; j--) {
      if (vwl(v[i + 2][j])) now++;
      if (now == k) {
        s3 = v[i + 2].substr(j);
        break;
      }
    }
    if (s3 == "b" || now < k) {
      cout << "NO\n";
      return;
    }
    now = 0, ln = v[i + 3].size();
    for (int j = ln - 1; j >= 0; j--) {
      if (vwl(v[i + 3][j])) now++;
      if (now == k) {
        s4 = v[i + 3].substr(j);
        break;
      }
    }
    if (s4 == "b" || now < k) {
      cout << "NO\n";
      return;
    }
    string cres = cnst(s1, s2, s3, s4);
    if (res == "aaaa" && cres != "aaaa") {
      res = cres;
      continue;
    }
    if (cres == "aaaa") continue;
    if (cres == "NO" || cres != res) {
      cout << "NO\n";
      return;
    }
  }
  cout << res + '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
