N=parse(Int,readline())
function add_s(s,maxs)
    if length(s)==N
        println(s)
    else
        for i in 1:(maxs+1)
            add_s(s*Char('a'+i-1),(i > maxs) ? i : maxs)
        end
    end
end

add_s('a',1)