A man takes 4 hours 30 minutes in walking to a certain place and riding back. He would have gained 2 hours by riding both ways. The time he would take to walk both ways is:

a) 6 hours
b) 7 hours
c) 8 hours
d) 9 hours