#include <bits/stdc++.h>
using namespace std;
int n, k;
string a[100], ans[100], str[100], q;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n - k + 1; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < 7; ++i) {
    q += ('a' + i);
  }
  for (int i = 0; i < 100; ++i) {
    str[i] = q;
    next_permutation(q.begin(), q.end());
  }
  for (int i = 1; i <= k; ++i) {
    ans[i] = str[i];
  }
  if (a[1].size() == 2 && k > 1) {
    ans[2] = ans[1];
  }
  for (int i = k + 1, j = 2; i <= n; ++i, ++j) {
    if (a[j].size() == 2) {
      ans[i] = ans[i - k + 1];
    } else {
      ans[i] = str[i];
    }
  }
  for (int i = 1; i <= n; ++i) {
    cout << "A" << ans[i] << " ";
  }
  return 0;
}
