#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;
void output(string s, int now, int finite) {
  if (now == finite) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i <= now; i++) {
    string t = s + char('a' + i);
    output(t, now + 1, finite);
  }
}
int main() {
  int n;
  cin >> n;
  output("", 0, n);
}
