#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, MAX = 1e5 + 5;
long long powN(long long a, long long p) {
  if (p == 0) return 1;
  long long z = powN(a, p / 2);
  z = (z * z) % MOD;
  if (p % 2) z = (z * a) % MOD;
  return z;
}
vector<bool> is_prime(MAX + 1, true);
void Sieve() {
  is_prime[0] = is_prime[1] = false;
  int i, j;
  for (i = 2; i * i <= MAX; i++) {
    if (is_prime[i]) {
      for (j = i * i; j <= MAX; j += i) is_prime[j] = false;
    }
  }
}
int n;
set<string> fun(int l) {
  string s;
  set<string> SS;
  if (l == 0) {
    SS.insert("");
    return SS;
  }
  set<string> P = fun(l - 1);
  for (auto p : P) {
    string s1, s2;
    s1 = s + 'a' + p;
    s2 = s + 'b' + p;
    SS.insert(s1);
    SS.insert(s2);
  }
  return SS;
}
int main() {
  cin >> n;
  set<string> SS;
  SS = fun(n - 1);
  for (auto s : SS) {
    string p = "a";
    p += s;
    cout << p << endl;
  }
}
