#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::string temp;
  temp.resize(N);
  for (int i = 0; i < N; ++i) {
    temp[i] = 'a' + i;
    for (int j = i + 1; j < N; ++j) {
      temp[j] = 'a';
    }
    std::cout << temp << std::endl;
    int k = N - 1;
    char max = 'a' + i;
    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;
}
