#N = gets.to_i
N = 10
P = '0'*(N-1)
n = -1
until (10**N-1) < n+=1
	s = "#{P}#{n}"[-N,N]
	x = '/'.ord
	i = (0...N).find{|i|
		y = s[i].ord
		x = y if y == x+1
		next x < y
	}
	if i
		(i...N).each{|j|
			s[j] = '9'
		}
		n = s.to_i
		next
	end
	puts s.tr('0-9','a-j')
end
