#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using namespace std;
using ll = long long;
template <typename T = ll>
using v = vector<T>;
template <typename T = ll>
using vv = v<v<T>>;
template <typename T = ll, typename U = ll>
using p = pair<T, U>;
template <typename T>
T chmin(T& a, T b) {
  return a = min(a, b);
}
template <typename T>
T chmax(T& a, T b) {
  return a = max(a, b);
}
const ll INF = (ll)1e9;
template <int MOD>
struct ModInt {
  using lint = long long;
  int val;
  ModInt(lint v = 0) : val(v % MOD) {
    if (val < 0) val += MOD;
  };
  ModInt operator+() const { return ModInt(val); }
  ModInt operator-() const { return ModInt(MOD - val); }
  ModInt inv() const { return this->pow(MOD - 2); }
  ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
  ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
  ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
  ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
  ModInt pow(lint n) const {
    auto x = ModInt(1);
    auto b = *this;
    while (n > 0) {
      if (n & 1) x *= b;
      n >>= 1;
      b *= b;
    }
    return x;
  }
  ModInt& operator+=(const ModInt& x) {
    if ((val += x.val) >= MOD) val -= MOD;
    return *this;
  }
  ModInt& operator-=(const ModInt& x) {
    if ((val -= x.val) < 0) val += MOD;
    return *this;
  }
  ModInt& operator*=(const ModInt& x) {
    val = lint(val) * x.val % MOD;
    return *this;
  }
  ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }
  bool operator==(const ModInt& b) const { return val == b.val; }
  bool operator!=(const ModInt& b) const { return val != b.val; }
  friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept {
    return is >> x.val;
  }
  friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept {
    return os << x.val;
  }
};
constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;
void a();
class b {
  ll h, w;

 public:
  b() {
    cin >> h >> w;
    ll ans1 = (w + 1) / 2;
    ll ans2 = w / 2;
    ans1 = (h + 1) / 2 * ans1;
    ans2 = h / 2 * ans2;
    cout << ans1 + ans2;
  }
};
void c() {
  ll a, b, c;
  cin >> a >> b >> c;
  if ((c - a - b) > 0 && (4 * a * b) < ((c - a - b) * (c - a - b))) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
ll N;
void dfs(string s) {
  if (s.size() == N) {
    do {
      bool chk = false;
      for (ll i = 0; i < (N); i++) {
        if (s[i] > 'a' + i) {
          chk = true;
          break;
        }
      }
      if (chk) continue;
      cout << s << endl;
    } while (next_permutation(s.begin(), s.end()));
    return;
  }
  s.push_back(s.back());
  dfs(s);
  s.back()++;
  dfs(s);
}
void d() {
  cin >> N;
  dfs("a");
}
int main() {
  d();
  return 0;
}
void a() {
  ll k;
  cin >> k;
  v<> s = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
           1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cout << s[k - 1];
  return;
}
