#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll LLINF{1001002003004005006};
vector<std::string> make_char(const int& N) {
  if (N == 1) {
    vector<std::string> tmp{"a"};
    return tmp;
  } else if (N == 2) {
    vector<std::string> tmp{"aa", "ab"};
    return tmp;
  } else {
    vector<std::string> tmp(N);
    vector<std::string> ans = make_char(N - 1);
    for (int i = 0; i < (N - 1); ++i) {
      tmp[i] = ans[i] + ((char)('a' + i));
    }
    tmp[N - 1] = ans[0] + "b";
    std::sort(tmp.begin(), tmp.end());
    return tmp;
  }
}
int main() {
  int N;
  cin >> N;
  vector<string> answer = make_char(N);
  for (int i = 0; i < (N); ++i) {
    cout << answer[i] << '\n';
  }
  return 0;
}
