#include <bits/stdc++.h>
using namespace std;
int addMod(int x, int y) {
  x += y;
  while (x >= 1000000000 + 7) x -= 1000000000 + 7;
  while (x < 0) x += 1000000000 + 7;
  return x;
}
int mulMod(int x, int y) { return (x * 1ll * y) % 1000000000 + 7; }
int binpow(int x, int y) {
  int z = 1;
  while (y) {
    if (y & 1) z = mulMod(z, x);
    x = mulMod(x, x);
    y >>= 1;
  }
  return z;
}
int inv(int x) { return binpow(x, 1000000000 + 7 - 2); }
int divide(int x, int y) { return mulMod(x, inv(y)); }
long long gcd(int a, int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long h(long long* A, int N) {
  long long pro = 1;
  for (int i = 0; i < N; ++i) pro = mulMod(A[i], pro);
  return pro;
}
long long f(long long* A, int N) {
  int alpha = A[0];
  for (int i = 1; i < N; ++i) {
    alpha = gcd(alpha, A[i]) % 1000000000 + 7;
  }
  return alpha;
}
void generateNormal(string ans, int N, int charUsed) {
  if (N == 0) {
    cout << ans << "\n";
    return;
  }
  for (int i = 0; i < charUsed + 1; ++i) {
    char currentChar = 'a' + i;
    generateNormal(ans + currentChar, N - 1, i + 1);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  string ans = "";
  generateNormal(ans, N, 0);
}
