N = gets.to_i
P = '0'*(N-1)
0.upto(10**N-1){|n|
	s = "#{P}#{n}"[-N,N]
	next unless s.chars.inject('/'){|a,b|
		 next a if a == b
		 next b if a.ord+1 == b.ord
		 next a if b.ord < a.ord
		 break false
	}
	puts s.tr('0-9','a-j')
}
