#include <bits/stdc++.h>
using namespace std;
string alp = "abcdefghijklm";
vector<string> ans;
int n;
void dfs(int num, int k, string s) {
  if (num == n) {
    ans.push_back(s);
    return;
  }
  string t = s;
  for (int i = 1; i <= k + 1; i++) {
    t.push_back(alp[i - 1]);
    dfs(num + 1, i, t);
    t.pop_back();
  }
}
int main() {
  cin >> n;
  string s;
  dfs(0, 0, s);
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
