#include <bits/stdc++.h>
using namespace std;
const static long long INF = 1e9;
const static long long MAXN = 301;
set<string> ST;
int N;
int base = 97;
int rec(int cnt, string S) {
  if (cnt == N) {
    ST.insert(S);
    return 0;
  }
  for (int i = 0; i < S[S.size() - 1] - base + 2; i++) {
    char tmp = (char)(base + i);
    string S_ = S;
    S_ += tmp;
    rec(cnt + 1, S_);
  }
  return 0;
}
int main() {
  cin >> N;
  rec(1, "a");
  for (auto s : ST) cout << s << endl;
}
