#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
long long N;
void dfs(string S, char c) {
  if (S.size() == N) {
    cout << S << endl;
    return;
  }
  for (char d = 'a'; d <= c; d++) {
    dfs(S + d, (c == d ? (char)(d + 1) : d));
  }
}
void solve() {
  cin >> N;
  dfs("", 'a');
}
signed main() { solve(); }
