#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<ll>;
const ll MOD = 1000000007;
int N;
vec cha;
void solve(int d, int cl) {
  for (int i = 0; i <= cl; ++i) {
    cha[d - 1] = i;
    if (d == N) {
      for (int c : cha) {
        cout << (char)((char)c + 'a');
      }
      cout << endl;
    } else {
      solve(d + 1, i + 1);
    }
  }
}
int main() {
  cin >> N;
  cha = vec(N);
  solve(1, 0);
  return 0;
}
