#include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;
struct init {
  init() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  }
} init_;
int main() {
  int N;
  cin >> N;
  vector<string> ans;
  for (int bit = 0; bit < (1 << (N - 1)); bit++) {
    string s;
    char c = 'a';
    for (int i = 0; i < N; i++) {
      s += c;
      if (bit >> i) c++;
    }
    ans.emplace_back(s);
  }
  sort(ans.begin(), ans.end());
  for (const auto& e : ans) cout << e << "\n";
  return 0;
}
