Measurement of the average shape of longitudinal profiles of cosmic-ray air showers at the Pierre Auger Observatory