#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<string>> v(n + 1);
  v[1].push_back("a");
  for (int i = 2; i <= n; i++) {
    for (long long j = 0; j < (v[i - 1].size()); j++) {
      string tmp = v[i - 1][j];
      for (long long k = 0; k < (i); k++) {
        string tmp2 = tmp + (char)('a' + k);
        v[i].push_back(tmp2);
      }
    }
  }
  sort((v[n]).begin(), (v[n]).end());
  for (long long i = 0; i < (v[n].size()); i++) {
    cout << v[n][i] << endl;
  }
  return 0;
}
