#include <bits/stdc++.h>
using namespace std;
int n;
void go(int len, int lim, string s) {
  if (len == n) {
    cout << s << '\n';
    return;
  }
  for (int i = 0; i <= min(25, (lim + 1)); i++) {
    string t = s;
    t += (char)('a' + i);
    go(len + 1, i, t);
  }
  return;
}
void solve() {
  cin >> n;
  string s = "";
  go(0, -1, s);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
