#include <bits/stdc++.h>
using namespace std;
vector<string> fill(int n) {
  if (n == 1) {
    vector<string> ans;
    ans.push_back("a");
    return ans;
  }
  unordered_map<string, int> mark;
  vector<string> sub = fill(n - 1);
  vector<string> ans;
  for (int i = 0; i < sub.size(); i++) {
    for (int j = 0; j < sub[i].size(); j++) {
      string k = sub[i] + sub[i][j];
      if (mark.find(k) == mark.end()) {
        mark.insert(make_pair(k, 1));
        ans.push_back(k);
      }
    }
    int x = sub[i][sub[i].length() - 1] - 'a';
    x++;
    string add;
    switch (x) {
      case 1:
        add = "b";
        break;
      case 2:
        add = "c";
        break;
      case 3:
        add = "d";
        break;
      case 4:
        add = "e";
        break;
      case 5:
        add = "f";
        break;
      case 6:
        add = "g";
        break;
      case 7:
        add = "h";
        break;
      case 8:
        add = "i";
        break;
      case 9:
        add = "j";
        break;
      case 10:
        add = "k";
        break;
      case 11:
        add = "l";
        break;
      default:
        printf("Choice other than 1, 2 and 3");
        break;
    }
    string k = sub[i] + add;
    mark.insert(make_pair(k, 1));
    ans.push_back(k);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  string s = "";
  vector<string> ans = fill(n);
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
