#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<string> ans;
  vector<string> next_ans;
  next_ans.push_back("a");
  ans = next_ans;
  for (int i = 1; i < n; i++) {
    next_ans.clear();
    for (int k = 0; k < ans.size(); k++) {
      next_ans.push_back(ans[k] + 'a');
    }
    for (int k = 0; k < ans.size(); k++) {
      bool flag = true;
      for (int l = 0; l < ans[k].size(); l++) {
        if ('a' + l != ans[k][l]) {
          flag = false;
          break;
        }
      }
      if (flag) {
        char next_c = 'a' + ans[k].size();
        string s = ans[k] + next_c;
        next_ans.push_back(s);
      }
    }
    for (int j = 1; j <= i; j++) {
      for (int k = 0; k < ans.size(); k++) {
        char c = 'a' + j;
        if (ans[k].find(c) != string::npos) {
          string s = ans[k] + c;
          next_ans.push_back(s);
        }
      }
    }
    ans = next_ans;
  }
  ans = next_ans;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
