#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<vector<char>> S;
  vector<char> C;
  for (int i = 0; i < (1 << (N - 1)); i++) {
    C = {'a'};
    for (int j = 0; j < N - 1; j++) {
      if (i & (1 << j)) {
        C.push_back(C[j] + 1);
      } else {
        C.push_back(C[j]);
      }
    }
    S.push_back(C);
  }
  sort(S.begin(), S.end());
  for (auto x : S) {
    for (auto y : x) {
      cout << y;
    }
    cout << endl;
  }
}
