the underlying compound interest formula that you want to use to solve this one is
A = P(1 + r/n)^nt
for this scenario that means solving for P algebraically and then plugging in the given parameters
P = 40000 / (1 + 0.107/4)^(4*10)
P = 40000 / 2.8747
P = 13914.63
meaning that if you invest $13,914.63 now it will grow to $40,000 in 10 years