#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;

char get_max(string t){
	int temp = 0;
	string s = "abcdefghij";
	for (int i = 0; i < t.length(); i++){
		for (int j = 0; j < s.length(); j++){
			if (t[i] == s[j]){
				temp = max(temp, j);
				break;
			}
		}
	}
	return s[temp];
}

int main(){
	int n;
	cin >> n;
	string s = "abcdefghijklmnopqrstuvwxyz";
	vector<string> num[11];
	num[1].push_back("a");
	for (int i = 2; i <= n; i++){
		for (int k = 0; k < num[i-1].size(); k++){
			for (int j = 0; j < i; j++){
				if (get_max(num[i-1][k]) + 2 == s[j]) break;
				num[i].push_back(num[i-1][k]+s[j]);
			}	
		}
	}
	for (int i = 0; i < num[n].size(); i+){
			cout << num[n][i] << endl;
	}
	return 0;
 }

