#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
vector<string> ans;
ll n;
void dfs(ll i, string s) {
  if (i == n) return;
  ans.push_back(s);
  ll x = s.size();
  char t = s[x - 1];
  dfs(i + 1, s + t);
  t++;
  dfs(i + 1, s + t);
}
int main() {
  cin >> n;
  string s = "a";
  dfs(0, s);
  sort(ans.begin(), ans.end());
  for (auto i : ans) {
    if (i.size() == n) cout << i << endl;
  }
}
