#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  vector<string> ans;
  scanf("%d\n", &n);
  n--;
  for (int tmp = 0; tmp < (1 << n); tmp++) {
    bitset<10> s(tmp);
    string a(n + 1, 'a');
    a[0] = 'a';
    for (i = 0; i < n; i++) {
      if (s.test(i)) {
        a[i + 1] = a[i];
      } else {
        if (a[i] != 'a') {
          a[i + 1] = a[i] - 1;
        } else {
          a[i + 1] = a[i] + 1;
        }
      }
    }
    ans.push_back(a);
  }
  sort(ans.begin(), ans.end());
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
