#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;
  char gh;
  for (char i = 'a'; i <= 'z'; ++i) {
    r++;
    beg += 'a';
    if (r == n) {
      gh = i;
      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();
        string s = t;
        string h = t;
        que.pop();
        if (t[i] != t[j]) {
          tmp.push(t);
          continue;
        }
        char p = t[i];
        char l = t[j];
        p++;
        l++;
        t[j] = p;
        h[i] = l;
        tmp.push(s);
        tmp.push(t);
        tmp.push(h);
      }
      while (!tmp.empty()) {
        string s = tmp.front();
        tmp.pop();
        que.push(s);
      }
    }
  }
  vector<string> ans;
  while (!que.empty()) {
    string res1 = que.front();
    que.pop();
    ans.emplace_back(res1);
  }
  sort((ans).begin(), (ans).end());
  auto itr = unique((ans).begin(), (ans).end());
  ans.erase(itr, ans.end());
  for (int i = 0; i < (ans.size()); ++i) {
    for (int j = 0; j < (n); ++j) {
      if (ans[i][j] == gh) {
        swap(ans[i], ans[ans.size() - 1]);
        ans.pop_back();
      }
    }
  }
  ans.emplace_back(beg);
  sort((ans).begin(), (ans).end());
  for (auto& c : ans) cout << (c) << "\n";
  return 0;
}
