Ram and Shyam started a business. Ram invested 40,000 for 6 months and then half of their average capital for the next 6 months. Shyam invested 50,000 for 6 months and then 1/4 of his initial capital for next 6 months. If the total profit earned is 100000, then find the difference of profit of ram and Shyam?