#include <bits/stdc++.h>
using namespace std;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
struct io {
  io() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
};
const int INF = INT_MAX;
const long long int LLINF = 1LL << 60;
const long long int MOD = 1000000007;
const double EPS = 1e-9;
void rec(vector<string>& ss, int depth, string& curs) {
  if (depth == 0) {
    ss.push_back(curs);
  } else {
    curs.push_back(curs.back());
    rec(ss, depth - 1, curs);
    curs.pop_back();
    curs.push_back(curs.back() + 1);
    rec(ss, depth - 1, curs);
    curs.pop_back();
  }
}
signed main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  ;
  vector<string> ss;
  string curs;
  curs.push_back('a');
  rec(ss, N - 1, curs);
  sort(ss.begin(), ss.end());
  for (string s : ss) {
    cout << (s) << '\n';
  }
}
