A characterization of Lorentz boosts