#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool umax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
long long POW(long long a, long long p, long long M) {
  if (!p) return 1LL;
  long long T = POW(a, p / 2, M);
  T = T * T % M;
  if (p & 1) T = T * (a % M) % M;
  return T;
}
long long SQRT(long long a) {
  long long b = (long long)sqrtl(((double)a) + 0.5);
  while (b * b < a) ++b;
  while (b * b > a) --b;
  return (b * b == a) ? b : -1;
}
const long long MOD = 1e9 + 7;
int dp[27][12];
vector<string> dpp[27][12];
void solve(int lst, int ps, int n) {
  if (ps == n + 1) return;
  if (dp[lst][ps] != -1) return;
  dp[lst][ps] = 0;
  for (int i = 1; i <= min(26, lst + 1); i++) {
    char h = 'a' + i - 1;
    string f = "";
    f += h;
    if (ps == n) {
      dpp[lst][ps].push_back(f);
      continue;
    }
    solve(lst + i == (lst + 1), ps + 1, n);
    for (auto it : dpp[lst + i == (lst + 1)][ps + 1]) {
      dpp[lst][ps].push_back(f + it);
    }
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  memset(dp, -1, sizeof(dp));
  int n;
  cin >> n;
  solve(0, 1, n);
  sort((dpp[0][1]).begin(), (dpp[0][1]).end());
  for (auto it : dpp[0][1]) cout << it << endl;
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
  return 0;
}
