#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
int F, H, I, J, K, L, M, N, S, T, U, W;
vector<string> alph = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
void generate(string deliverable, int variety) {
  for (int i = 0; i < (variety); i++) {
    if (deliverable.length() == N - 1) {
      cout << deliverable + alph[i] << endl;
    } else {
      generate(deliverable + alph[i], variety + 1);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  generate("", 1);
  return 0;
}
