#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 1e6 + 200;
const long long INF = 9999999999999;
const double eps = 1e-7;
int n;
vector<string> rst;
void dfs(string s, int sp, int k) {
  if (sp >= n) return;
  for (int i = sp; i < n; i++) {
    s[i] += k;
    rst.push_back(s);
    s[i] -= k;
  }
  s[sp] += k;
  dfs(s, sp + 1, k + 1);
}
int main() {
  cin >> n;
  string s = "";
  for (int i = 0; i < n; ++i) {
    s += 'a';
  }
  rst.push_back(s);
  dfs(s, 1, 1);
  sort(rst.begin(), rst.end());
  long long len = rst.size();
  for (int i = 0; i < len; ++i) {
    cout << rst[i] << endl;
  }
  return 0;
}
