def main():
    import sys
    input = sys.stdin.readline

    p = int(input())
    lis = []
    if p == 1:
        print("a")
    else:
        for i in range(2,p+1):
            n = (2 ** (i-1)) - 1
            lis1 = []
            for j in range(n+1):
                lis1.append(format(j,"b").zfill(i))
            lis.append(lis1)
        lis_cor = [lis[0]]
        for i in range(1,len(lis)):
            lisnew = []
            for j in range(len(lis[i])):
                num = lis[i][j].count("1")
                if num > 1:
                    for x in lis_cor[num-2]:
                        x1 = str(int(x) + int(lis[i][j]))
                        lisnew.append(x1.zfill(i+2))
                else:
                    lisnew.append(lis[i][j])
            lis_cor.append(lisnew)
        str_lis = ["a","b","c","d","e","f","g","h","i","j","k"]
        st = ""
        lis_cor1 = list(set(lis_cor[p-2]))
        st_l = []
        for y in lis_cor1:
            for j in range(len(y)):
                st1 = str_lis[int(y[j])]
                st += st1
            st_l.append(st)
            st = ""
        
        st_l.sort()
        for x in st_l:
            print(x)
            



if __name__ == "__main__":
    main()