#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
int dx[] = {-1, 0, 1};
int n;
set<string> ans;
void func(string str, char x) {
  if (str.length() == n) {
    ans.insert(str);
    return;
  }
  char tmp, mx;
  for (int i = 0; i < 3; ++i) {
    tmp = x - dx[i];
    if ('a' <= tmp && tmp <= 'z') {
      mx = max(x, tmp);
      func(str + tmp, mx);
    }
  }
}
void solve() {
  cin >> n;
  func("a", 'a');
  for (auto c : ans) cout << c << "\n";
  ;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
