#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vpii = vector<pair<int, int>>;
using vivi = vector<vector<int>>;
using vbvb = vector<vector<bool>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int mod = 1000000007;
const int inf = 1001001001;
int main(void) {
  int n;
  cin >> n;
  vector<vector<string>> ans(10);
  ans[0].push_back("a");
  for (int i = 0; i < (int)(n - 1); i++) {
    for (int k = 0; k < (int)(ans[i].size()); k++) {
      string s = ans[i][k];
      for (int j = 0; j < (int)(s.size()); j++) {
        string p = s;
        string q = s;
        char x = s[j] + 1;
        p.push_back(s[j]);
        q.push_back(x);
        ans[i + 1].push_back(p);
        ans[i + 1].push_back(q);
      }
    }
  }
  set<string> ansdayo;
  for (int i = 0; i < (int)(ans[n - 1].size()); i++) {
    ansdayo.insert(ans[n - 1][i]);
  }
  while (!ansdayo.empty()) {
    cout << *begin(ansdayo) << endl;
    ansdayo.erase(*begin(ansdayo));
  }
}
