#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
int n;
void dfs(int k, string s) {
  if (k == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= char(s[k - 1] + 1); ++c) {
    dfs(k + 1, s + c);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  dfs(1, "a");
}
