#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++) {
    for (int m = 0; m < next_ans.size(); m++) {
      next_ans[m] += 'a';
    }
    for (int j = 1; j <= i; j++) {
      char c = 'a' + j;
      for (int k = 0; k < ans.size(); k++) {
        char last_c = 'a';
        for (int l = 0; l < ans[k].size(); l++) {
          if (last_c < ans[k][l]) last_c = ans[k][l];
        }
        char next_c = last_c + 1;
        string s = ans[k] + next_c;
        next_ans.push_back(s);
        if (ans[k].find(c) != string::npos) {
          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;
  }
}
