#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const 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;
}
inline string getline() {
  string s;
  getline(cin, s);
  return s;
}
inline void yn(const bool b) {
  b ? cout << ("yes") << '\n' : cout << ("no") << '\n';
}
inline void Yn(const bool b) {
  b ? cout << ("Yes") << '\n' : cout << ("No") << '\n';
}
inline void YN(const bool b) {
  b ? cout << ("YES") << '\n' : cout << ("NO") << '\n';
}
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;
void dfs(string s) {
  if (s.size() == n)
    cout << (s) << '\n';
  else {
    for (char i = 'a'; i <= s[s.size() - 1] + 1; i++) {
      dfs(s + (char)i);
    }
  }
}
int main() {
  cin >> n;
  dfs("a");
}
