In a class test, the sum of the marks obtained by P in mathematics and science is 28. Had he got 3 more marks in mathematics and 4 marks less in science, the product of marks obtained in the two subjects would have been 180. Find the marks obtained by him in the two subjects separately.