N = int(input())

arr=[1]*N


if(N==1):
    print("a")
    exit()

def num2alpha(num):
    return chr(num+96)

def keta(num):
    if(arr[num-1]<arr[num]):
        keta(num-1)
    else:
        for k in range(num+1,N):
            arr[k] = 1
        arr[num] += 1
        


i = N-1
while arr[0]==1:
    ans = map(num2alpha,arr)
    print((''.join(ans)))
    keta(N-1)


