#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::string temp;
  temp.resize(N);
  for (int start = N - 1; start >= 0; --start) {
    for (int j = 0; j < start; ++j) {
      temp[j] = 'a';
    }
    for (int i = start + 1; i < N; ++i) {
      int offset = i - start;
      temp[i] = 'a' + offset;
      for (int j = i + 1; j < N; ++j) {
        temp[j] = 'a';
      }
      std::cout << temp << std::endl;
      int k = N - 1;
      char max = 'a' + offset;
      while (k > i) {
        if (temp[k] + 1 <= max) {
          temp[k] += 1;
          for (int j = k + 1; j < N; ++j) {
            temp[j] = 'a';
          }
          k = N - 1;
          std::cout << temp << std::endl;
        } else {
          k -= 1;
        }
      }
    }
  }
  return 0;
}
