John came out of the post office after spending 12$ on 20 cent, 30 cent and 50 cent stamps. He bought 40 stamps altogether and the amount of 20 cent stamps bought is equal to the sum of the amount of 30 cent stamps and 50 cent stamps bought.

Write 3 linear equations to represent the above information.