#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string beg = "";
  int r = 0;
  for (char i = 'a'; i <= 'z'; ++i) {
    beg += i;
    r++;
    if (r == n) break;
  }
  queue<string> que;
  que.push(beg);
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i + 1; j < n; ++j) {
      queue<string> tmp;
      while (!que.empty()) {
        string t = que.front();
        que.pop();
        if (t[i] == t[j]) continue;
        t[j] = t[i];
        tmp.push(t);
      }
      while (!tmp.empty()) {
        string s = tmp.front();
        tmp.pop();
        que.push(s);
      }
    }
  }
  if (n != 1) que.push(beg);
  vector<string> ans;
  while (!que.empty()) {
    string res1 = que.front();
    que.pop();
    ans.emplace_back(res1);
  }
  sort((ans).begin(), (ans).end());
  for (auto& c : ans) cout << (c) << "\n";
  return 0;
}
