Billy, Perry and Wesley shared the cost of a gift. The ratio of Billy's share to the total share of Perry and Wesley was 1 : 3. The ratio of Perry's share to the total share of Billy and Wesley was 1 : 7. Wesley's share was $6 more than Billy's share. How much did the gift cost?