#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int N = 2e3 + 5;
const int mod = 998244353;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> have[15];
  have[0].push_back("");
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= i; ++j) {
      for (int id = 0; id < (int)have[i - 1].size(); ++id) {
        string s = have[i - 1][id] + (char)(j + 'a' - 1);
        have[i].push_back(s);
      }
    }
  }
  sort(have[n].begin(), have[n].end());
  for (string x : have[n]) cout << x << '\n';
  return 0;
}
