The six-point formula for a perfect sandwich