#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
const long long INF =
    sizeof(long long) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const long long MOD = (long long)1e9 + 7;
const double EPS = 1e-9;
long long N;
void func(long long s, long long idx, long long col) {
  s *= 10;
  s += idx;
  if (col == N) {
    string res;
    for (long long i = (0), i_len = (N); i < i_len; i++) {
      res += 'a' + s % 10;
      s /= 10;
    }
    reverse(begin(res), end(res));
    cout << res << endl;
    return;
  }
  for (long long i = (0), i_len = (idx + 2); i < i_len; i++) {
    func(s, i, col + 1);
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  func(0, 0, 1);
  return 0;
}
