al = "abcdefghijklmnopqrstuvwxyz"
def dfs(s: "char", max_char: "int", n: "int", k):
    if(n<k):
        dfs(s+al[max_char], max_char, n+1, k)
        dfs(s+al[max_char+1], max_char+1, n+1, k)


    if n==k:
        print(s)



def main():
    k = int(input())
    #文字を選ぶ選ばないdfs
    dfs("a", 0, 1, k)


if __name__ == '__main__':
    main()
