#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int factorial(int n) {
  int x = 1;
  for (int i = 1; i <= n; ++i) x *= i;
  return x;
}
int main() {
  int N;
  char mx = 'a';
  cin >> N;
  deque<string> L;
  L.push_back("a");
  while (L.size() != factorial(N)) {
    mx = 'a';
    string S = L.front();
    L.pop_front();
    for (int i = 0; i < S.size(); ++i) {
      if (mx < S.at(i)) mx = S.at(i);
    }
    for (int i = 0; i <= mx - 'a' + 1; ++i) {
      char A = 'a' + i;
      if (S.size() == N - 1) cout << S + A << endl;
      L.push_back(S + A);
      if (S + A == "a" && N == 1) return 0;
      if (S + A == "ab" && N == 2) return 0;
      if (S + A == "abc" && N == 3) return 0;
      if (S + A == "abcd" && N == 4) return 0;
      if (S + A == "abcde" && N == 5) return 0;
      if (S + A == "abcdef" && N == 6) return 0;
      if (S + A == "abcdefg" && N == 7) return 0;
      if (S + A == "abcdefgh" && N == 8) return 0;
      if (S + A == "abcdefghi" && N == 9) return 0;
      if (S + A == "abcdefghij" && N == 10) return 0;
    }
  }
}
