#include <bits/stdc++.h>
using namespace std;
long long const mod = 1000000007;
inline long long add(long long a, long long b) {
  return ((a % mod) + (b % mod) + mod) % mod;
}
inline long long mul(long long a, long long b) {
  return (((a % mod) * (b % mod)) % mod + mod) % mod;
}
inline long long sub(long long a, long long b) {
  return ((a % mod) - (b % mod) + mod) % mod;
}
long long power(long long x, long long y, long long m) {
  if (y == 0) return 1;
  long long p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long modInv(long long x) { return power(x, mod - 2, mod) % mod; }
vector<string> func(long long n) {
  vector<string> v, v1;
  if (n == 1) {
    v.push_back("a");
    return v;
  }
  v = func(n - 1);
  for (auto second : v) {
    char c = second[n - 2];
    long long id = int(c) - 'a';
    for (long long i = 0; i < 26 && i <= id + 1; i++) {
      string p = second + char(i + 'a');
      v1.push_back(p);
    }
  }
  return v1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<string> v;
  v = func(n);
  for (auto second : v) cout << second << endl;
  return 0;
}
