#include <bits/stdc++.h>
using namespace std;
vector<string> ans;
void dfs(int l = 1, int n = 0, string s = "") {
  if (l == 0) {
    ans.push_back(s);
    return;
  }
  for (int i = 0; i <= n; i++) {
    s.push_back('a' + i);
    dfs(l - 1, i + 1, s);
    s.pop_back();
  }
}
int main() {
  int n;
  cin >> n;
  dfs(n);
  for (auto&& e : ans) {
    cout << e << endl;
  }
}
