A passenger upon the front train A observes that he passes the complete length of train B in 33 seconds when traveling in the same direction as B and in 3 seconds when traveling in the opposite direction. If B is 330 ft long, find the speed of the two trains.