Two long-time rival football teams, let us call them (for beautiful manners) and (for miserable manners), are playing again. Both teams are exhausted, so the first to score a goal will win the game for sure. At this moment, team has the ball. If they decide to go all-in, for a direct attack, there is a probability that they manage to score, thus winning the game. Hovewer, with probability they will lose the ball while their goal is unprotected, and therefore they will lose. Team has another option: to just pass the ball around. In that case, the possesion of the ball will eventually go to team . Then we will have a simmetrical situation: If team goes for a direct attack, they will win with probability , and they will lose with probability . If they decide to just pass the ball and wait, eventually the possesion of the ball will go back to team .
Given and , and assuming that both teams take the best decisions (to attack or not to attack) and that team has the ball now, which is the probability that team will win?
Input consists of several cases, each with two real numbers and , both between 0 and 1. No given probability is . The input cases have no precission issues.
For every case, print the probability that team will win with four digits after the decimal point. If no goal will be scored, state so.
Input
0.75 0.42 0 0.23 0.3 0.60004
Output
0.7500 NO GOAL 0.4000