#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr long long MOD = 1000000007;
using Graph = vector<vector<long long>>;
void sol(long long x, string s) {
  if (s.size() == x) {
    cout << s << endl;
    return;
  } else {
    long long n = s.size() + 1;
    for (long long i = 0; i < (long long)(n); i++) {
      char ns = 'a' + i;
      sol(x, s + ns);
    }
  }
}
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  sol(N, "a");
}
