Glen, Nick and Ahmad shared the cost of a gift. The ratio of Glen's share to the total share of Nick and Ahmad was 1 : 4. The ratio of Nick's share to the total share of Glen and Ahmad was 1 : 7. Nick's share was $198 less than Ahmad's share. How much did the gift cost?