#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n);

	std::string s = "", t = "abcdefghi";
	std::vector<std::string> ans;
	auto solve = [&](auto&& solve, int now, int ind) {
		if(ind == n) {
			ans.push_back(s);
			return;
		} else {
			s += t[now];
			solve(solve, now + 1, ind + 1);			
			solve(solve, now, ind + 1);
			s.pop_back();
		}
	};
	solve(solve, 0, 0);

	sort(begin(ans), end(ans));
	ans.erase(unique(begin(ans), end(ans)), end(ans));

	for(auto v: ans) printf("%s\n", v.c_str());
	return 0;
}
