output_description: Print the expected number of games that will be played, in the manner
  specified in the statement.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N A B C
attempt: #!/usr/bin/env python3
  import sys
  
  MOD = 1000000007  # type: int
  
  
  def gcd(a, b):
      if b == 0:
          return a
      return gcd(b, a % b)
  
  
  def reduce(y, x):
      tmp = gcd(x, y)
      return (y // tmp, x // tmp)
  
  
  def get_z(y, x):  # y/x (mod 1000000007)
      inv_x = pow(x, MOD - 2, MOD)
      return y * inv_x % MOD
  
  
  def make_combs(n, k):
      fact = [1] * (n + 1)
      for i in range(2, n + 1):
          fact[i] = (fact[i - 1] * i) % MOD
  
      ret = [0] * (n + 1)
      for i in range(k, n + 1):
          a = fact[i]
          b = (fact[k] * fact[i - k]) % MOD
          ret[i] = get_z(a, b)
      return ret
  
  
  def make_pow(y, x, n):
      ret = [0] * (n + 1)
      yy = [1] * (n + 1)
      xx = [1] * (n + 1)
      for i in range(1, n + 1):
          yy[i] = (yy[i - 1] * y) % MOD
          xx[i] = (xx[i - 1] * x) % MOD
      for i in range(n + 1):
          # print(yy[i], xx[i])
          ret[i] = get_z(yy[i], xx[i])
      return ret
  
  
  def solve(n: int, A: int, B: int, C: int):
      y = 0
      x = 0
      AB = 100 - C
      combs = make_combs(2 * n, n - 1)
      a, a_ab = reduce(A, AB)
      b, b_ab = reduce(B, AB)
      a_pow = make_pow(a, a_ab, n)
      b_pow = make_pow(b, b_ab, n)
      # print(combs)
      # print(a_pow)
      # print(b_pow)
      for i in range(n, n * 2):
          com = combs[i - 1]
          # tmp  = (A / ab) ** (n) + (B / ab) ** (i - n)
          # tmp += (B / ab) ** (n) + (A / ab) ** (i - n)
          tmp = a_pow[n] * b_pow[i - n]
          tmp += b_pow[n] * a_pow[i - n]
          # print(a_pow[n], b_pow[i - n], b_pow[n], a_pow[i - n])
          x = (x + tmp * com) % MOD
          y = (y + tmp * com * i) % MOD
      x = (x * (100 - C)) % MOD
      y = (y * 100) % MOD
      ret = get_z(y, x)
      print(ret)
      return
  
  
  def main():
      def iterate_tokens():
          for line in sys.stdin:
              for word in line.split():
                  yield word
  
      tokens = iterate_tokens()
      N = int(next(tokens))  # type: int
      A = int(next(tokens))  # type: int
      B = int(next(tokens))  # type: int
      C = int(next(tokens))  # type: int
      solve(N, A, B, C)
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  Takahashi and Aoki will play a game. They will repeatedly play it until one of
  them have N wins in total.
  
  When they play the game once, Takahashi wins with probability A %, Aoki wins
  with probability B %, and the game ends in a draw (that is, nobody wins) with
  probability C %. Find the expected number of games that will be played, and
  print it as follows.
  
  We can represent the expected value as P/Q with coprime integers P and Q.
  Print the integer R between 0 and 10^9+6 (inclusive) such that R \times Q
  \equiv P\pmod {10^9+7}. (Such an integer R always uniquely exists under the
  constraints of this problem.)
samples: [{"input": "1 25 25 50", "output": "2\n    \n\nSince N=1, they will repeat the game until one of them wins. The expected\nnumber of games played is 2.\n\n* * *"}, {"input": "4 50 50 0", "output": "312500008\n    \n\nC may be 0.\n\n* * *"}, {"input": "1 100 0 0", "output": "1\n    \n\nB may also be 0.\n\n* * *"}, {"input": "100000 31 41 28", "output": "104136146"}]