#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  queue<string> q;
  vector<string> ans;
  ans.push_back("a");
  for (int i = 2; i <= n; ++i) {
    for (int k = 0; k < (ans.size()); ++k) {
      if (ans[k].size() == i - 1) q.push(ans[k]);
    }
    while (!q.empty()) {
      string s = q.front();
      q.pop();
      for (int j = 0; j < (i); ++j) {
        ans.push_back(s + char('a' + j));
      }
    }
  }
  for (int i = 0; i < (ans.size()); ++i) {
    if (ans[i].size() == n) {
      set<char> se;
      int mx = 0;
      for (int j = 0; j < (n); ++j) {
        se.insert(ans[i][j]);
        mx = max(mx, ans[i][j] - 'a' + 1);
      }
      if (se.size() == mx) cout << ans[i] << endl;
    }
  }
  return 0;
}
