Ryan, Tommy and Elijah shared the cost of a gift. The ratio of Ryan's share to the total share of Tommy and Elijah was 1 : 3. The ratio of Tommy's share to the total share of Ryan and Elijah was 1 : 4. Elijah's share was $78 more than Ryan's share. How much did the gift cost?