Set the downwind flight time x hours and the headwind time y hours.
x+y=8
900x=700y
Solution:
x=3.5
y=4.5
Then the flight distance s = 900 * x = 900 * 3.5 = 3 150km.
If you don't know this equation:
The flying distance is 900 * 8 * (700/(700+900) = 3150km.
(It can be understood that the distance between the downwind and the headwind must be the same, so the flight time should be inversely proportional to the speed, that is, 700/(700+900))