See the attached figure to better understand the problem
we know that
PB+BQ=1000 ft------->PB=1000-BQ-------> equation 1
in the triangle PAB
tan 50=AB/PB----------> AB=PB*tan 50------> equation 2
in the triangle ABQ
tan 25=AB/BQ------> AB=BQ*tan 25-------> equation 3
equals equation 2 and equation 3
PB*tan 50=BQ*tan 25--------> equation 4
substitute equation 1 in equation 4
[1000-BQ]*tan 50=BQ*tan 25-----> 1000*tan 50-BQ*tan 50=BQ*tan 25
BQ*[tan 25+tan 50]=1000*tan 50-----> BQ=1000*tan 50/[tan 25+tan 50]
BQ=718.76 ft
PB=1000-718.76-----> PB=281.24 ft
AB=PB*tan 50-----> 281.24*tan 50------> 335.17 ft
the answer is
335.17 ft