#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = INT_MAX / 2;
constexpr auto MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  vector<vector<string> > s(n, vector<string>(0));
  s[0] = {""};
  s[1] = {"a"};
  if (n == 1) cout << "a" << endl;
  for (int i = 0; i < (n - 1); i++) {
    int k = i + 2;
    for (int j = 0; j < (s[k - 1].size()); j++) {
      string ne = s[k - 1][j];
      int last = 0;
      for (int l = 0; l < (ne.size()); l++) last = max(last, ne[l] - 'a');
      for (int m = 0; m < (last + 2); m++) {
        string nes = ne;
        char sd = 'a' + m;
        nes += sd;
        if (k == n)
          cout << nes << endl;
        else
          s[k].push_back(nes);
      }
    }
  }
}
