Build a software application simulating a bank.
Implement simulate_bank(operations), which processes operations in order while maintaining account balances. Support account creation, deposits, withdrawals, transfers, and balance queries. Deposits, withdrawals, and transfers include unique transaction IDs and must be idempotent: repeating an ID returns the original result without changing state. Transfers must be atomic, so insufficient funds or invalid accounts leave both balances unchanged.
Input is a list of operation dictionaries. Return one result dictionary per operation. Amounts are nonnegative integer cents. Use {"ok": true} for successful mutations, include balance for balance queries and successful deposits or withdrawals, and use {"ok": false, "error": "..."} for rejected operations. Use the exact operation shapes shown in the examples.
def simulate_bank(operations):