def dfs(word, i):
    if len(word) == n:
        print(word)
    else:
        if i == 0:
            dfs(word + chr(97), 1)
        else:
            for j in range(i+1):
                if j != i:
                    dfs(word + chr(97 + j), j)
                else:
                    dfs(word + chr(97 + j), j+1)


if __name__ == "__main__":
    n = int(input())

    dfs('', 0)
