#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int main() {
  long long n;
  cin >> n;
  vector<vector<vector<string> > > s(n + 1, vector<vector<string> >(n + 1));
  s[0][0].push_back("");
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (n); j++) {
      for (auto e : s[i][j]) {
        for (int k = (0); k < (j); k++) {
          s[i + 1][j].push_back(e + (char)('a' + k));
        }
        s[i + 1][j + 1].push_back(e + (char)('a' + j));
      }
    }
  }
  for (int i = (0); i < (n + 1); i++) {
    for (auto e : s[n][i]) {
      cout << e << endl;
    }
  }
}
