#include <bits/stdc++.h>
using namespace std;
int n;
string s;
vector<string> v;
void go(int pos) {
  if (pos == n) {
    v.push_back(s);
    return;
  }
  for (int i = 0; i < s[pos - 1] - 'a' + 2; i++) {
    s[pos] = 'a' + i;
    go(pos + 1);
  }
}
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) s += 'a';
  go(1);
  for (auto i : v) cout << i << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
