#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
std::random_device rd;
std::mt19937 mt(rd());
constexpr long long MOD = 1e9 + 7;
constexpr long long MAX = 200020;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr long long INF = 1e18;
vector<string> ans;
long long N;
void dfs(string s, long long c) {
  if (c >= N) {
    ans.push_back(s);
    return;
  }
  long long n = s.size();
  char las = s[n - 1];
  dfs(s + las, c + 1);
  dfs(s + char(las + 1), c + 1);
}
void solve() {
  cin >> N;
  string s = "a";
  dfs(s, 1);
  sort(ans.begin(), ans.end());
  ;
  for (long long i = 0; i < ans.size(); ++i) {
    cout << (ans[i]) << '\n';
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}
