#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool next_combination(const T first, const T last, int k) {
  const T subset = first + k;
  if (first == last || first == subset || last == subset) {
    return false;
  }
  T src = subset;
  while (first != src) {
    src--;
    if (*src < *(last - 1)) {
      T dest = subset;
      while (*src >= *dest) {
        dest++;
      }
      iter_swap(src, dest);
      rotate(src + 1, dest + 1, last);
      rotate(subset, subset + (last - dest) - 1, last);
      return true;
    }
  }
  rotate(first, subset, last);
  return false;
}
void check(vector<vector<char>> &a) {
  for (vector<char> x : a) {
  }
}
int main() {
  int n;
  cin >> n;
  int size = pow(n, n - 1);
  vector<vector<char>> a(size, vector<char>(n));
  vector<char> buf;
  for (int i = 0; i < n; ++i) buf.push_back('a');
  while (true) {
    if (buf.at(0) != 'a') break;
    a.push_back(buf);
    next_combination(buf.begin(), buf.end(), n);
  }
  check(a);
  return 0;
}
