#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string alph = "abcdefghijklmnopqrstuvwxyz";
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  map<string, bool> seen;
  vector<string> anss;
  for (int bit = 2; bit < (1 << n); ++bit) {
    string ans = "";
    char same = '.';
    int same_cnt = 0;
    for (int i = 0; i < n; ++i) {
      if (bit & (1 << i)) {
        if (same == '.') {
          same = alph[i];
        }
        ans += same;
        same_cnt++;
      } else {
        ans += alph[i];
      }
    }
    if (!seen[ans]) {
      seen[ans] = true;
      anss.push_back(ans);
    }
  }
  sort(anss.begin(), anss.end());
  for (int i = 0; i < anss.size(); ++i) {
    cout << anss[i] << endl;
  }
}
