When an agent acts for a principal to enter a contract with a third party, the parties to the contract thus formed are _____.
A. the principal and the agent
B. the principal and the third party
C. the agent and the third party
D. the principal, the agent, and the third party