#include <bits/stdc++.h>
using namespace std;
constexpr int Inf = 1000000000;
constexpr long long INF = 1e18;
constexpr long long MOD = 1000000007;
const double PI = 3.1415926535897;
int N;
void solve(int M, int a, string S) {
  if (a == N) {
    cout << S << endl;
    return;
  }
  if (a < M) {
    char C = 'a' + a;
    solve(M, a + 1, S + C);
  } else if (a == M) {
    for (int i = 0; i < M; i++) {
      char C = 'a' + i;
      solve(M, a + 1, S + C);
    }
  } else {
    for (int i = 0; i <= M; i++) {
      char C = 'a' + i;
      solve(M, a + 1, S + C);
    }
  }
  return;
}
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    solve(i, 0, "");
  }
}
