#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
inline int std_in(int& a) { return scanf("%d", &a); }
auto pint_compare = [](pint x, pint y) -> bool { return (x.first < y.first); };
const int MOD = 1000000007;
int N;
void solve(int depth, int width, string S) {
  if (depth == N) {
    cout << (S) << "\n";
    return;
  }
  int m = 1;
  for (int(i) = 0; (i) < (S.length()); ++(i)) {
    m = max(m, S[i] - 'a' + 1);
  }
  for (int(i) = 0; (i) < (max(m, width)); ++(i)) {
    string str(S);
    str.push_back('a' + i);
    solve(depth + 1, i + 2, str);
  }
}
signed main() {
  cin >> N;
  solve(0, 1, "");
  return 0;
}
