#include <bits/stdc++.h>
using namespace std;
void dfs(int n, char c, vector<string>& v, string& s, string acc = "") {
  if (n == 0) {
    v.push_back(acc);
    return;
  }
  s.push_back(c);
  for (auto nc : s) dfs(n - 1, c + 1, v, s, acc + nc);
}
int main() {
  int n;
  cin >> n;
  string s = "";
  vector<string> v;
  dfs(n, 'a', v, s);
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); ++i) {
    if (i > 0) cout << " ";
    cout << v[i];
  }
  cout << endl;
}
