#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmin(T &a, T b) {
  a = min(a, b);
}
template <class T>
inline void chmax(T &a, T b) {
  a = max(a, b);
}
long long N;
vector<long long> dp[11][11];
vector<string> res;
void out(long long x) {
  string ans;
  for (long long i = 0; i < N; i++) {
    ans.push_back('a' + (x % 10));
    x /= 10;
  }
  reverse(ans.begin(), ans.end());
  res.push_back(ans);
}
signed main() {
  cin >> N;
  dp[1][0].push_back(0);
  for (long long i = 1; i < N; i++) {
    for (long long j = 0; j < i; j++) {
      for (long long k = 0; k < j + 2; k++) {
        for (long long l : dp[i][j]) {
          dp[i + 1][k].push_back(l * 10 + k);
        }
      }
    }
  }
  for (long long i = 0; i < N; i++) {
    for (long long j : dp[N][i]) {
      out(j);
    }
  }
  sort(res.begin(), res.end());
  for (string s : res) cout << s << endl;
}
