#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<vector<string>> ans(N);
  ans[0] = {"a"};
  for (int i = 0; i < N - 1; i++) {
    int n = ans[i].size();
    for (int j = 0; j < n; j++) {
      string s = ans[i][j];
      char c = s[s.size() - 1];
      for (int k = 0; k < c - 'a' + 2; k++) {
        ans[i + 1].push_back(s + (char)('a' + k));
      }
    }
  }
  for (int i = 0; i < ans[N - 1].size(); i++) {
    cout << ans[N - 1][i] << "\n";
  }
}
