#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 + 1);
  s[0] = {""};
  s[1] = {"a"};
  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 = ne[ne.size() - 1] - 'a' + 2;
      for (int m = 0; m < (last); m++) {
        string nes = ne;
        char sd = 'a' + m;
        nes += sd;
        s[k].push_back(nes);
      }
    }
  }
  for (int i = 0; i < (s[n].size()); i++) cout << s[n][i] << endl;
}
