#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  array<vector<string>, 10> ans;
  ans[0].push_back("a");
  for (int i = 0; i < N; i++) {
    for (int k = 0; k < ans[i].size(); k++) {
      for (int j = 0; j <= i + 1; j++) {
        ans[i + 1].push_back(ans[i][k] + static_cast<char>(97 + j));
      }
    }
  }
  for (int i = 0; i < ans[N - 1].size(); i++) {
    cout << ans[N - 1][i] << endl;
  }
}
