#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<vector<string>> S(N);
  S.at(0).push_back("a");
  for (int i = 1; i < N; i++) {
    for (auto T : S.at(i - 1)) {
      for (int j = 0; j < i + 1; j++) {
        string TT = T;
        TT.push_back((char)('a' + j));
        S.at(i).push_back(TT);
      }
    }
  }
  sort(S.at(N - 1).begin(), S.at(N - 1).end());
  int n = S.at(N - 1).size();
  for (int i = 0; i < n; i++) {
    cout << S.at(N - 1).at(i) << endl;
  }
}
