#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  string first(n, 'a');
  for (int i = 0; i < n; i++) {
    first[i] += i;
  }
  ans.push_back(first);
  for (int bit = 0; bit < (1 << n); bit++) {
    string temp(n, 'a');
    int cnt = 0;
    char next = 'b';
    for (int i = 0; i < n; i++) {
      if ((bit >> i) & 1) {
        cnt++;
      } else {
        temp[i] = next;
        next++;
      }
    }
    if (cnt < 2)
      continue;
    else
      ans.push_back(temp);
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < (int)ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
