The can initially contains 7xand 5xof mixtures A and B respectively.
Quantity of A in mixture left =  7x  7  x 9  litres =  7x  21  litres.  
12  4 
Quantity of B in mixture left =  5x  5  x 9  litres =  5x  15  litres.  
12  4 
 =  7  
 9 
28x 21  =  7  
20x+ 21  9 
252x 189 = 140x+ 147
112x= 336
x= 3.
So, the can contained 21 litres of A.

