#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  for (int i = 0; i < (int)n; i++) {
    int l = n - i - 1;
    for (int j = 0; j < (1 << l); j++) {
      char c = 'a';
      string s = "";
      for (int k = 0; k < (int)i + 1; k++) {
        s += c;
        c++;
      }
      char d = c - 1;
      for (int k = 0; k < (int)l; k++) {
        if (j & (1 << k))
          s += d;
        else {
          s += c;
          c++;
        }
      }
      if (j != 0)
        ans.push_back(s);
      else if (i == 0)
        ans.push_back(s);
    }
  }
  sort(ans.begin(), ans.end());
  for (auto s : ans) cout << s << endl;
  return 0;
}
