#include <bits/stdc++.h>
using namespace std;
template <typename X>
bool exist(vector<X> vec, X item) {
  return find(vec.begin(), vec.end(), item) != vec.end();
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long power(long long x, long long n) {
  if (n == 0) return 1;
  return (n % 2) ? x * power(x, n - 1) % 1000000007
                 : power(x * x % 1000000007, n / 2);
}
long long dx[] = {0, 0, -1, 1};
long long dy[] = {1, -1, 0, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<vector<string> > ans;
  long long K;
  cin >> K;
  for (long long i = (long long)0; i < (long long)K; i++) {
    vector<string> tmp;
    string nxt = "";
    for (int j = 0; j <= i; j++) {
      nxt += ('a' + j);
    }
    if (i == 0) {
      tmp.push_back(nxt);
    } else {
      for (long long j = (long long)0; j < (long long)ans[i - 1].size(); j++) {
        string now = ans[i - 1][j];
        for (long long k = (long long)0; k < (long long)nxt.size(); k++) {
          tmp.push_back(now + nxt[k]);
        }
      }
    }
    ans.push_back(tmp);
  }
  for (long long i = (long long)0; i < (long long)ans[K - 1].size(); i++) {
    cout << ans[K - 1][i] << endl;
  }
  return 0;
}
