#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
const int mod = 1e9 + 7;
string s;
set<string> se;
void dfs(int n, int i, int sum) {
  if (sum > n) return;
  if (sum == n) {
    se.insert(s);
    return;
  }
  for (int k = 1; k <= n; k++) {
    s += string(k, char('a' + i));
    dfs(n, i + 1, sum + k);
    for (int i = 0; i < k; i++) s.pop_back();
  }
}
int32_t main() {
  int n;
  cin >> n;
  s = "";
  dfs(n, 0, 0);
  for (auto x : se) cout << x << '\n';
  return 0;
}
