#include <bits/stdc++.h>
const int MGN = 10;
const int ARY_SZ_MAX = (int)1e7;
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vc = vector<char>;
using vvc = vector<vc>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using psl = pair<string, ll>;
int N;
vc C;
void dfs(int n, string res) {
  if (n >= N) {
    printf("%s\n", res.c_str());
    return;
  }
  for (int i = 0; i < C.size(); i++) {
    if (res[n - 1] + 1 < C[i]) continue;
    dfs(n + 1, res + C[i]);
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = int(0); i < int(N); ++i) {
    C.push_back((char)('a' + i));
  }
  dfs(1, "a");
  return 0;
}
