#include <bits/stdc++.h>
using namespace std;
int dx8[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -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;
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  fill((T*)array, (T*)(array + N), val);
}
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;
int N;
string s = "";
void dfs(int v) {
  if (v == N) {
    cout << (s) << endl;
  }
  char currentBigAlpha = 'a';
  while (s.find(currentBigAlpha) != string::npos) {
    currentBigAlpha++;
  }
  currentBigAlpha--;
  for (char c = 'a'; c <= currentBigAlpha + 1; c++) {
    s += c;
    dfs(v + 1);
    s.pop_back();
  }
}
int main() {
  cin >> N;
  dfs(0);
}
