from collections import Counter

N = int(input())
alpha = [chr(i) for i in range(97, 97+26)]

temp = []
for n in range(N):
  result = []
	for i in temp:
    	temp_list = list(i)
  		type = len(Counter(temp_list))
  
  			for j in range(type):
    			result.append(i + alpha[j])
	temp = result.copy()
    
print('\n'.join(result))