#include <bits/stdc++.h>
using i64 = int_fast64_t;
namespace std {
template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
};  // namespace std
class Partition {
 public:
  int count;
  Partition(int n) {
    x_ = std::vector<int>(std::min(1, n), n);
    h_ = n > 1 ? 0 : -1;
    count = 0;
  }
  std::vector<int> &next() {
    if (x_.empty()) return x_;
    if (count > 0) {
      if (h_ < 0) {
        x_.clear();
        return x_;
      }
      if (x_[h_] == 2) {
        --x_[h_--];
        x_.push_back(1);
      } else {
        int r = --x_[h_];
        int t = x_.size() - h_;
        while (t >= r) {
          x_[++h_] = r;
          t -= r;
        }
        if (t == 0) {
          x_.resize(h_ + 1);
        } else {
          x_.resize(h_ + 2, 1);
          if (t > 1) x_[++h_] = t;
        }
      }
    }
    ++count;
    return x_;
  }

 private:
  std::vector<int> x_;
  int h_;
};
std::vector<std::string> solve2(int n) {
  Partition p(n);
  std::vector<std::string> ans;
  std::vector<int> v;
  while (true) {
    v = p.next();
    if (v.empty()) {
      break;
    }
    std::string s;
    for (auto &x : v) {
      for (int j = (0); (j) < (x); ++(j)) {
        s += 'a' + j;
      }
    }
    ans.emplace_back(s);
  }
  return ans;
};
int solve() {
  int n;
  std::cin >> n;
  auto ans = solve2(n);
  std::sort(ans.begin(), ans.end());
  for (int i = (0); (i) < (ans.size()); ++(i)) {
    std::cout << ans[i] << std::endl;
  }
  return 0;
}
int main() {
  std::cin.tie(nullptr);
  solve();
  return 0;
}
