#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int i = N - 1;
  vector<int> S_N(N, 0);
  while (1) {
    int i = N - 1;
    string S(N, 'a');
    for (int j = (int)(0); j < (int)(N); j++) {
      S[j] += S_N[j];
    }
    cout << S << endl;
    while (S_N[i - 1] < S_N[i]) {
      i--;
    }
    if (i == 0) {
      break;
    } else {
      S_N[i]++;
      for (int k = (int)(i + 1); k < (int)(N); k++) {
        S_N[k] = 0;
      }
    }
  }
  return 0;
}
