#include <bits/stdc++.h>
using namespace std;

std::string stress(int n, int E, const vector<string>& kk, double TME = 1.0, int seed = 3431) {
  vector<set<string>> can(40);
  vector<size_t> pos(kk.size());
  auto keys = kk;

  mt19937 rnd(seed);
  auto t0 = clock();
  string s;
  size_t STEPS = 4;
  int it = 1;
  string steps;
  for (; it % 100 || static_cast<double>(clock() - t0) < TME * CLOCKS_PER_SEC; it++) {
    std::ranges::fill(pos, 0U);
    s.clear();
    s.reserve(STEPS);
    steps.clear();
    for (size_t i = 0; i < STEPS; i++) {
      auto ind = rnd() % kk.size();
      steps.push_back(char('0' + ind));
      char ch = keys[ind][pos[ind] % keys[ind].length()];
      pos[ind]++;
      s.push_back(ch);
      can[s.length()].insert(s);
    }
  }
  can[0] = {""};
  for (size_t len = 1; len < can.size(); len++) {
    if (len > STEPS) {
      return "NO";
    }
    if (can[len].size() < can[len - 1].size() * E) {
      for (const auto& word : can[len - 1]) {
        string check = word + "_";
        for (char ch = 'a'; ch < static_cast<char>('a' + E); ch++) {
          check.back() = ch;
          if (!can[len].contains(check)) {
            return check;
          }
        }
      }
    }
  }
  assert(false);
}

int main() {
#ifdef LOCAL
  std::ignore = freopen("../a.in", "r", stdin);
#endif
  int n, E;
  vector<string> keys;
  cin >> n >> E;
  keys.resize(n);
  for (auto &s: keys) cin >> s;
  cout << stress(n, E, keys, 0.8) << "\n";
}
