Invest one company's money in another company and make independent accounting. How to write the accounting entries of both parties?

Suppose the investor is a and the investee is B.

Accounting treatment:

Borrow: long-term equity investment -b

Loans: bank deposits

B. Accounting treatment:

Debit: bank deposit

Loan: paid-in capital -a