#include <bits/stdc++.h>
using namespace std;
const int max_n = 1e5;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
const int inf = 1 << 30;
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;
}
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
vector<set<int> > pls;
map<string, int> ma, num;
int n;
void dfs(string s, char mx) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= mx + 1; c++) {
    dfs(s + c, c);
  }
}
int main() {
  cin >> n;
  dfs("", 'a' - 1);
  return 0;
}
