A man borrowed Rs.50000 at simple interest with the rate of interest not remaining constant for the entire period. He repaid the entire amount after 8 years. The rate of interest for the first two years is 8% p.a., for the next three years it is 10% p.a., for the next two years it is 5% p.a. and 7% for the last year. How much amount did he repay to clear his loan at the end of the period?