from commandManager import CommandManager



def main():
    command_manager = CommandManager()
    order_distribution, waiter_load = command_manager.run()
    print("----- DISTRIBUTED ORDERS ------------------------")
    for i, distribution in enumerate(order_distribution):
        print(f"\n--- Order Distribution {i+1} ---")
        # Unpack the tuple if needed
        if isinstance(distribution, tuple):
            distribution = distribution[0]
        for product, waiters_info in distribution.items():
            print(f"Product: {product}")
            for waiter, quantity in waiters_info.items():
                print(f"  - {waiter}: {quantity} unit(s)")

    print("\n--- Final Waiter Load ---")
    for waiter, load in waiter_load.items():
        print(f"{waiter}: {load} total cost units")


if __name__ == "__main__":
    main()