N=int(input())
def hyoujyun(n):
	if n==1:
    	A=[1]
    	return A
    else:
    	A=[hyoujyun(n-1)+[i] for i in range(n)]
		return A
A=hyoujyun[N]
if N==1:
	print("a")
else:
	for i in range(len(A)):
		Ans=[]
		for j in range(len(A[i])):
			if A[i][j]==1:
				Ans.append(a)
			if A[i][j]==2:
				Ans.append(b)
			if A[i][j]==3:
				Ans.append(c)
			if A[i][j]==4:
				Ans.append(d)
			if A[i][j]==5:
				Ans.append(e)
			if A[i][j]==6:
				Ans.append(f)
			if A[i][j]==7:
				Ans.append(g)
			if A[i][j]==8:
				Ans.append(h)
			if A[i][j]==9:
				Ans.append(i)
			if A[i][j]==10:
				Ans.append(j)
		print Ans