#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
void d_err() { cerr << endl; }
template <typename H, typename... T>
void d_err(H h, T... t) {
  cerr << h << " ";
  d_err(t...);
}
long long INF = 1e16;
int inf = 1e9;
long long MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int N;
  cin >> N;
  vector<string> ans;
  ans.push_back("a");
  for (int i = (0); i < (N - 1); ++i) {
    vector<string> tmp;
    for (auto s : ans) {
      tmp.push_back(s + "a");
      tmp.push_back(s + "b");
    }
    ans = tmp;
  }
  sort(ans.begin(), ans.end());
  for (int i = (0); i < (ans.size()); ++i) {
    cout << ans[i] << endl;
  }
}
