import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np


def main():
	n=int(input())
	s="abcdefghijklmn"

	li=[[] for _ in range(10)]
	li[0]="a"

	for i in range(1,10):
		for t in li[i-1]:
			for j in range(i+1):
				if ord(t[-1])+1>=ord(s[j]):
					li[i].append(t+s[j])

	for i in li[n-1]:
		print(i)


if __name__ == "__main__":
	main()
