Stationary configuration of some optimal shaping