
n = gets.to_i

a = "a"
s = a*n

l = s.length-1

array = []
for i in 0..n-1 do
    array.push(("a".bytes[0]+i).chr)
end

array = array.repeated_permutation(n-1).to_a

for i in 0..array.length-1 do
    puts "a" + array[i].join("")
end