#include <bits/stdc++.h>
using namespace std;
void dfs(long long rest, string s, long long bit, long long n) {
  if (rest == 0) {
    cout << s << endl;
    return;
  }
  for (long long i = 1; i < n; i++) {
    if (bit & (1 << (i - 1)) == 1) {
      dfs(rest - 1, s + char((i - 1) + 'a'), bit, n);
      if (bit & (1 << i) == 0) {
        dfs(rest - 1, s + char(i + 'a'), (bit + (1 << i)), n);
      }
    }
  }
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  dfs(n - 1, "a", 1, n);
}
