#include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;
struct init {
  init() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  }
} init_;
int main() {
  int N;
  cin >> N;
  vector<string> ans(1, "a");
  for (int i = 1; i < N; i++) {
    vector<string> tmp;
    for (const auto& e : ans) {
      const char b = e.back();
      if (e.back() != 'a') tmp.emplace_back(e + char(b - 1));
      tmp.emplace_back(e + b);
      tmp.emplace_back(e + char(b + 1));
    }
    swap(ans, tmp);
  }
  sort(ans.begin(), ans.end());
  for (const auto& e : ans) cout << e << "\n";
  return 0;
}
