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


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

    dfs('', 0)
