#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void dfs(string a, int n, int cnt, vector<string> &ans) {
  if (cnt == n) {
    ans.push_back(a);
    return;
  }
  ++cnt;
  for (int i = 0; i < (cnt); ++i) {
    string next = a + (char)('a' + i);
    dfs(next, n, cnt, ans);
  }
  return;
}
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  dfs("", n, 0, ans);
  for (auto tmp_ans : ans) {
    cout << tmp_ans << endl;
  }
  return 0;
}
