Josephson effect in multiterminal topological junctions