#include <bits/stdc++.h>
using namespace std;
long long fac[2000005];
void pre() {
  fac[0] = 1;
  fac[1] = 1;
  for (int i = 2; i < 200005; i++) fac[i] = (i * fac[i - 1]) % 1000000007;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return res % 1000000007;
}
long long ncr(long long n, long long r) {
  return ((fac[n] * power(fac[r], 1000000007 - 2)) % 1000000007 *
          power(fac[n - r], 1000000007 - 2)) %
         1000000007;
}
vector<string> v;
long long n;
void solve(int idx, string s, char te) {
  if (idx == n) {
    v.push_back(s);
    return;
  }
  long long count = te - 'a';
  long long p5 = min(n, idx * 1LL + 1);
  for (int i = count; i < p5; i++) {
    char p1 = 'a' + i;
    string p2 = s;
    p2 += p1;
    solve(idx + 1, p2, p1);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    cin >> n;
    string s1 = "a";
    char p3 = 'a';
    solve(1, s1, p3);
    sort(v.begin(), v.end());
    for (auto it : v) cout << it << endl;
  }
}
