A wave bounces off the shore and moves towards an anchored ship. It bounces off the ship again and returns to shore. The time taken for the wave to return back to the shore is 6 s. If the average depth of the sea is 3 m, what is the distance of the ship from the shore?