#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
vector<string> have_seen;
bool check(string s) {
  map<char, int> mp;
  int counter = 0;
  for (int i = 0; i < (s.size()); ++i) {
    if (mp[s[i]]) {
      s[i] = 'a' + mp[s[i]] - 1;
    } else {
      mp[s[i]] = mp.size();
      s[i] = 'a' + mp[s[i]] - 1;
    }
  }
  if (count((have_seen).begin(), (have_seen).end(), s) > 0) {
    return false;
  } else {
    have_seen.push_back(s);
    return true;
  }
}
void solve(int rest, string s) {
  if (rest == 0) {
    if (check(s)) {
      cout << s << endl;
    }
  } else {
    for (char c = 'a'; c <= 'a' + n - rest; ++c) {
      solve(rest - 1, s + c);
    }
  }
}
signed main() {
  cin >> n;
  solve(n, "");
  return 0;
}
