#include <bits/stdc++.h>
using namespace std;
void print_ans(vector<int> &ans) {
  for (int i = 0; i < ans.size(); i++) {
    cout << (char)('a' + ans.at(i));
  }
  cout << endl;
}
void print_answers(vector<vector<int>> &answers) {
  for (int i = 0; i < answers.size(); i++) {
    print_ans(answers.at(i));
  }
}
void set_ans(int len, int index, vector<int> &ans) {
  int now_len = 1;
  for (int i = 0; i < ans.size(); i++) {
    if (i >= index && now_len <= len) {
      ans.at(i) = now_len;
      now_len++;
    } else {
      ans.at(i) = 0;
    }
  }
}
int main() {
  int N;
  cin >> N;
  vector<vector<int>> answers;
  vector<int> ans(N);
  answers.push_back(ans);
  for (int len = 1; len <= N - 2; len++) {
    for (int i = N - len; i >= 0; i--) {
      set_ans(len, i, ans);
      answers.push_back(ans);
    }
  }
  if (N > 1) {
    for (int i = 0; i < N; i++) {
      ans.at(i) = i;
    }
    answers.push_back(ans);
  }
  sort(answers.begin(), answers.end());
  print_answers(answers);
}
