#include <bits/stdc++.h>
using namespace std;
using ll = long long;
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;
}
const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;
int N;
string ans;
char can;
void prt(int n) {
  for (char ch = 'a'; ch <= can; ch++) {
    ans[n] = ch;
    char can2 = can;
    can = ch + 1;
    if (n + 1 < N) {
      prt(n + 1);
    } else {
      cout << ans << endl;
    }
    can = can2;
  }
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    ans += 'a';
  }
  can = 'a';
  prt(0);
}
