#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename T>
using ve = vector<T>;
template <typename T>
using pq2 = priority_queue<T>;
template <typename T>
using pq1 = priority_queue<T, vector<T>, greater<T>>;
int N;
ve<string> ans;
void dfs(int n, ve<char> A, string s) {
  ve<char> B = A;
  B.push_back(char(A.back() + 1));
  if (n == N) {
    ans.push_back(s);
  } else {
    for (char p : A) {
      dfs(n + 1, B, s + p);
    }
  }
}
int main() {
  cin >> N;
  dfs(0, {'a'}, "");
  sort(ans.begin(), ans.end());
  for (int i = 0; i < (ans.size()); i++) cout << ans[i] << endl;
  return 0;
}
