Optimal triple configurations of stationary shocks