N=parse(Int,readline())
s=fill(Char(97),N)

i=0
flag=true
re=[]
for i in 0:(2^(N-1)-1)
    sp=fill(0,N)
    for j in 2:N
        sp[j]=sp[j-1]+((i & 2^(N-j))>0)
    end
    push!(re,(s.+sp)...)
    (i==(2^(N-1)-1)) || push!(re,Char(10))
end
print.(re);