Write code to sort packages based on their dimensions and weight.
Implement sort_packages(packages), where packages is a list of dictionaries containing id, length, width, height, and weight. Return a new list sorted ascending by length, then width, height, weight, and finally ID; do not modify the input list. For example, packages with keys (1, 2, 6, 3) and (2, 2, 3, 3) appear in that order.
def sort_packages(packages):