#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<int(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define show(x) cout<< #x << " = " << x << endl
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,ll>pil;
typedef pair<ll,ll> pll;

int vx[]={0,0,-1,1};
int vy[]={1,-1,0,0};
int dx[]={1,0,-1,1,-1,1,0,-1};
int dy[]={1,1,1,0,0,-1,-1,-1};

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}	

const ll mod=1e9+7;
const int INF=INT_MAX/2;
const int N_MAX=300010;

int main(){
	int n;
	cin>>n;
	vector<string> s;
	s.push_back("a");
	cout<<"a"<<endl;
	REP(t,n){
		vector<string> s_temp;
		REP(i,s.size()){
			REP(j,i+2){
				vector<bool> type=vector<bool>(11,false);
				int cnt=0;
				char c_temp;
				string str;
				c_temp='a'+j;
				str=s[i]+c_temp;
				REP(k,str.size()){
					if(!type[str[k]-'a']){
						cnt++;
						type[str[k]-'a']=true;
					}
				}
				int max_id=0;
				REP(k,11)if(type[k])max_id=max(k,max_id);
				if(max_id<cnt){
					s_temp.push_back(s[i]+c_temp);
				}
			}
		}
		s=s_temp;
		REP(i,s_temp.size())cout<<s_temp[i]<<endl;
		if(i==s.size()-1)break;
	}
	return 0;
}
