#include <bits/stdc++.h>
using namespace std;
long long n, color[20], ans;
set<string> s;
void backtrack(long long i, long long cur) {
  if (i > n) {
    for (long long j = 1; j <= n; j++) {
      char c = color[j] + 'a' - 1;
      cout << c;
    }
    cout << '\n';
  } else {
    for (long long j = 1; j <= cur; j++) {
      color[i] = j;
      backtrack(i + 1, cur + 1);
    }
  }
}
void solve() {
  cin >> n;
  backtrack(1, 1);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
