#include <bits/stdc++.h>
#define ll double
using namespace std;
int n;
char s[20];
void Go(int x){ 
	if (x==n) {
		for (int i=0; i<n; i++)
			cout<<s[i];
			cout<<"\n";
		return ;
	}
	
	for (char c='a'; c<=s[x-1]+1; c++) {
		s[x]=c;
		Go(x+1);
	}
	return ;	
}

main () {
	cin>>n;
	s[0]='a';
	Go(1);
}