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