You are building the core engine of a small banking system. The engine processes a chronological list of commands and returns the outputs produced by query commands, in order.
Each command is a list whose first element is the operation name and whose second element is an integer timestamp. The supported commands are:
- ["deposit", time, account, amount]: add amount to account (accounts start at balance 0 the first time they are referenced).
- ["transfer", time, src, dst, amount]: move amount from src to dst only if src currently has at least amount; otherwise the command has no effect.
- ["schedule", time, src, dst, amount, exec_time]: register a transfer of amount from src to dst that should take effect once the system clock reaches exec_time. At execution, it behaves exactly like a transfer (skipped if funds are insufficient at that moment).
- ["balance", time, account]: produce the current balance of account (0 if it has never been referenced).
- ["top", time, k]: produce a list of the k account ids with the highest balances; ties are broken by account id in ascending lexicographic order.
Processing rule for time: before a command at timestamp t is applied, every scheduled transfer whose exec_time is less than or equal to t must be executed first. Scheduled transfers whose exec_time are equal are executed in the order they were registered.
Return the list of outputs for the query commands (["balance", ...] and ["top", ...]) in the order they appear.