#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string hairetu = "abcdefghijklmnopqrstuvwxyz";
  vector<vector<string>> arr(11, vector<string>(0));
  arr[1].push_back("a");
  int N;
  cin >> N;
  for (int i = 2; i <= N; i++) {
    int SIZE = arr[i - 1].size();
    for (int j = 0; j < SIZE; j++) {
      string s = arr[i - 1][j];
      int kaisu = s[i - 2] - 'a' + 2;
      for (int k = 0; k < kaisu; k++) {
        string PUT = arr[i - 1][j] + hairetu[k];
        arr[i].push_back(PUT);
      }
    }
  }
  for (int i = 0; i < arr[N].size(); i++) {
    cout << arr[N][i] << endl;
  }
}
