min_char = "abcdefghij"

def dtype(start, num):
    string_array = []
    if num > 0:
        for m in range(num):
            string = ""
            for _ in range(num-m):
                string += min_char[start]
            part_array = dtype(start+1, m)
            if part_array:
                for part in part_array:
#                    print(string+part)
                    string_array.append(string+part)
            else:
                string_array.append(string)
    return string_array

###
# main
if(__name__ == '__main__'):
    # input
    n = int(input())

    accomplishment = dtype(0, n)

    # output
    for ans in accomplishment:
        print(ans)
# else:
    # do nothing
