#include <bits/stdc++.h>
using namespace std;
const char alphabet[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
const int threshold[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int N, idx[10] = {0}, now, length = 0;
bool flag = true;
int main(int argc, char const *argv[]) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  cin >> N;
  now = N - 2;
  while (1) {
    for (int i = 0; i < N; ++i) cout << alphabet[idx[i]];
    cout << "\n";
    if (flag)
      flag = false;
    else
      break;
    for (int i = N - 1; i >= now; --i) {
      if (idx[i] < threshold[i - now - 1] && i > now) {
        ++idx[i];
        break;
      } else if (idx[i] == threshold[i - now - 1]) {
        if (i > now + 1) {
          idx[i] = 0;
        } else {
          for (int j = N - 1; j >= now; --j) idx[j] = 0;
          ++idx[i - 1];
          --now;
          break;
        }
      }
    }
    for (int i = 0; i < N; ++i) {
      if (idx[i] != threshold[i] - 1) flag = true;
    }
    if (flag) continue;
  }
  return 0;
}
