#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000")
#pragma warning(disable : 6031)
#pragma warning(disable : 4244)
#pragma warning(disable : 26451)
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long mod = int(1e9) + 7;
const int INF = 1e9;
const long long LINF = 1e18;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << setprecision(18) << fixed;
  int n;
  cin >> n;
  vector<string> cur{"a"};
  for (int i = 1; i < n; i++) {
    vector<string> next;
    for (auto s : cur) {
      for (char c = 'a'; c <= 'z'; c++) {
        if (c <= s[(int)(s).size() - 1] + 1) next.push_back(s + c);
      }
    }
    cur = next;
  }
  sort((cur).begin(), (cur).end());
  for (auto s : cur) cout << s << "\n";
  return 0;
}
