#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
const ll MOD = 1e9 + 7;
const ll LINF = 1LL << 60;
const int INF = 1e9 + 7;
map<string, int> ans;
int n;
void dfs(string s) {
  if (s.size() == n)
    ans[s] = 1;
  else {
    for (ll i = 0; i < (s.back() - 'a') + 2; ++i) {
      dfs(s + char('a' + i));
    }
  }
}
int main() {
  cin >> n;
  dfs("a");
  for (auto &[key, value] : ans) {
    cout << key << endl;
  }
}
