#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
void asspush(queue<string>& S, int N) {
  while (S.front().size() != N) {
    for (size_t i = 'a'; i <= S.front().at(S.front().size() - 1) + 1; i++) {
      S.push(S.front() + char(i));
    }
    S.pop();
  }
}
int main() {
  int N;
  cin >> N;
  queue<string> S;
  S.push("a");
  vector<string> U;
  asspush(S, N);
  while (!S.empty()) {
    U.push_back((S.front()));
    S.pop();
  }
  sort(U.begin(), U.end());
  for (size_t i = 0; i < U.size(); i++) {
    cout << U.at(i) << endl;
  }
}
