#include <bits/stdc++.h>
using namespace std;
string s = "";
int dfs(int n, int mask) {
  if (n == 0) {
    cout << s << '\n';
  } else {
    int i;
    for (i = 0; i < 26; i++) {
      if (mask & (1 << i)) {
        s += string(1, i + 'a');
        dfs(n - 1, mask);
        s.pop_back();
      } else {
        break;
      }
    }
    s += string(1, i + 'a');
    dfs(n - 1, mask | (1 << i));
    s.pop_back();
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  freopen("INPUT.txt", "r", stdin);
  freopen("OUTPUT.txt", "w", stdout);
  freopen("OUTPUT_ERROR.txt", "w", stderr);
  int n;
  cin >> n;
  dfs(n, 0);
}
