Let x = number of foxes six years ago
Then, x+80 = number of deer six years ago
Number of deer now = 2(x+80) = 2x+160
Number of foxes now = x+40
So, (2x+160) + (x+40) = 365
3x = 165 x = 55
Six years ago, there were 55 foxes and 135 deer present in the park.