#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  bool flag = 1;
  for (int i = 0; i < (int)((1 << n) - 1); i++) {
    string now(n, 'a');
    int tmp = 1;
    for (int j = 0; j < (int)(n); j++) {
      if (i >> j & 1) {
        now[j] += tmp;
        tmp++;
      }
    }
    if (tmp == n) {
      if (flag)
        flag = 0;
      else
        continue;
      sort(now.begin(), now.end());
    }
    ans.push_back(now);
  }
  sort(ans.begin(), ans.end());
  for (auto x : ans) cout << x << endl;
}
