#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>
using namespace std;

char Y(int m){
    char Z[11]={'a','b','c','d','e','f','g','h','i','j'};
    return Z[m];
}


string f(int N,int x){
    string s;
    for (int ii=0;ii<N;ii++){
        s[ii]=Y[x%10]_cstr;
        x=x/10;
    }
    return s;
}

int main(){
    int N;
    cin>>N;
   // char Y[11]={'a','b','c','d','e','f','g','h','i','j'};
    long int A[10][100000];
    A[0][0]=0;
    A[0][1]=-1;
    int j=0,n=0;
    for (int i=1;i<N;i++){
        j=0;
        while (A[i-1][n]!=-1){
            for (int k=0;k<=1+A[i-1][n]/pow(10,i-1);k++){
                A[i][j]=A[i-1][n]+pow(10,i)*k;
                j+=1;
            }
        }
        A[i][j]=-1;
    }
    int nn=0;
    while (nn!=-1){
        cout<<f(N,A[N][nn])<<endl;
    }
    return 0;
    }