You are writing a short adventure story for your English class. In your story, two submarines on a secret mission need to arrive at a place in the middle of the Atlantic ocean at the same time. They start out at the same time from positions equally distant from the rendezvous point. They travel at different velocities but both go in a straight line. The first submarine travels at an average velocity of 20 km/hr for the first 500 km, 40 km/hr for the next 500 km, 30 km/hr for the next 500 km and 50 km/hr for the final 500 km. In the plot, the second submarine is required to travel at a constant velocity. What is that velocity?