A takes 3 hours more than B to walk a distance of 30 km. But, if A doubles his pace (speed) he is ahead of B by 1(1/2) hours. Find the speeds of A and B.