Let a + ar + ar^2 + ar^3 + \dotsb be an infinite geometric series. The sum of the series is $4.$ The sum of the cubes of all the terms is $10.$ Find the common ratio.