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