n = int(input())

s = ['a']*(n)
#print(''.join(s))

def dfs(x,alp):
    if x == n-1:
        print(''.join(s))
        return
    
    for i in range(alp+2):
        #print(x+1)
        s[x+1] = chr(i+65+32)
        dfs(x+1,alp+1)



dfs(0,0)