#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};
int main() {
  int n;
  cin >> n;
  vector<vector<vs>> a(n + 1, vector<vs>(n + 1));
  a[1][1].push_back("a");
  for (int i = 1, i_len = (n); i < i_len; ++i) {
    for (int j = 1, j_len = (i + 1); j < j_len; ++j) {
      for (auto v : a[i][j]) {
        for (int k = 1, k_len = (j + 2); k < k_len; ++k) {
          a[i + 1][k].push_back(v + (char)('a' + k - 1));
        }
      }
    }
  }
  vs ans;
  for (int j = 1, j_len = (n + 1); j < j_len; ++j) {
    for (auto v : a[n][j]) ans.push_back(v);
  }
  sort(begin(ans), end(ans));
  for (auto v : ans) cout << v << endl;
}
