#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int INF = 100000002;
const double PI = 4 * atan(1);
const double eps = 1e-7;
const long long oo = 1e18;
void dfs(int d, string s, int N) {
  if (d == N)
    cout << s << endl;
  else {
    for (int i = 0; i <= d; i++) {
      dfs(d + 1, s + (char('a' + i)), N);
    }
  }
}
int main() {
  int N;
  cin >> N;
  dfs(0, "", N);
}
