#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] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int N, idx[10];
bool flag = true;
int main(int argc, char const *argv[]) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  cin >> N;
  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 >= 0; --i) {
      if (idx[i] < threshold[i]) {
        ++idx[i];
        for (int j = i + 1; j < N; ++j) idx[j] = 0;
        break;
      }
    }
    for (int i = 0; i < N; ++i) {
      if (idx[i] != threshold[i]) flag = true;
    }
    if (flag)
      continue;
    else
      flag = false;
  }
  return 0;
}
