#include <bits/stdc++.h>
using namespace std;
static const long long INF = 1000000000000000000LL;
static const long long MOD = 1000000007;
int n;
int shutu(string v) {
  cout << v << endl;
  return 0;
}
int dfs(string v, int cnt) {
  if (cnt == n) {
    shutu(v);
    return 0;
  }
  for (int i = 0; i <= cnt; ++i) {
    char c = i + 'a';
    dfs(v + c, cnt + 1);
  }
  return 0;
}
int main() {
  cin >> n;
  string s = "";
  dfs(s, 0);
  return 0;
}
