#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
void dfs(string &s, int i, char c) {
  if (i == 0) {
    return;
  }
  s.push_back(c);
  for (char d = 'a'; d <= c; d++) {
    dfs(s, i - 1, d);
  }
  dfs(s, i - 1, c + 1);
  if (i == 1) {
    cout << s << endl;
  }
  s.pop_back();
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string v;
  dfs(v, n, 'a');
  return 0;
}
