4. A train passes a building at a constant speed. For 30 seconds, the train is "visible from head to tail but not in full view", and for 10 seconds the train is "visible from head but not from tail". The train completely passes the building in $\qquad$ seconds.
$50$