Problem:
Score : 700 points

Problem Statement

Today, Snuke will eat B pieces of black chocolate and W pieces of white chocolate for an afternoon snack.

He will repeat the following procedure until there is no piece left:

Choose black or white with equal probability, and eat a piece of that color if it exists.

For each integer i from 1 to B+W (inclusive), find the probability that the color of the i-th piece to be eaten is black.
It can be shown that these probabilities are rational, and we ask you to print them modulo 10^9 + 7, as described in Notes.

Notes

When you print a rational number, first write it as a fraction \frac{y}{x}, where x, y are integers and x is not divisible by 10^9 + 7
(under the constraints of the problem, such representation is always possible).
Then, you need to print the only integer z between 0 and 10^9 + 6, inclusive, that satisfies xz \equiv y \pmod{10^9 + 7}.

Constraints

All values in input are integers.

1 \leq B,W \leq 10^{5}

Input

Input is given from Standard Input in the following format:

B W

Output

Print the answers in B+W lines. In the i-th line, print the probability that the color of the i-th piece to be eaten is black, modulo 10^{9}+7.

Sample Input 1

2 1

Sample Output 1

500000004
750000006
750000006

There are three possible orders in which Snuke eats the pieces:

white, black, black

black, white, black

black, black, white

with probabilities \frac{1}{2}, \frac{1}{4}, \frac{1}{4}, respectively. Thus, the probabilities of eating a black piece first, second and third are \frac{1}{2},\frac{3}{4} and \frac{3}{4}, respectively.

Sample Input 2

3 2

Sample Output 2

500000004
500000004
625000005
187500002
187500002

They are \frac{1}{2},\frac{1}{2},\frac{5}{8},\frac{11}{16} and \frac{11}{16}, respectively.

Sample Input 3

6 9

Sample Output 3

500000004
500000004
500000004
500000004
500000004
500000004
929687507
218750002
224609377
303710940
633300786
694091802
172485353
411682132
411682132

Solution in Fortran (gfortran v4.8.4) (judge verdict: Accepted)

module mod_black_or_white
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer(8) :: f(0:200000), invf(0:200000), invp(0:200000)
contains
  subroutine init(n)
    implicit none
    integer, intent(in) :: n
    integer :: i
    integer(8) :: p
    f = 0_8
    invf = 0_8
    f(0) = 1_8
    p = 1_8
    do i = 1, n
      f(i) = mod(f(i-1)*int(i,8),md)
      p = mod(p*2_8,md)
    end do
    invf(n) = inv(f(n))
    invp(n) = inv(p)
    do i = n, 1, -1
      invf(i-1) = mod(invf(i)*int(i,8),md)
      invp(i-1) = mod(invp(i)*2_8,md)
    end do
    return
  end subroutine init
  integer(8) function perm(n,k)
    implicit none
    integer, intent(in) :: n, k
    perm = 0_8
    if (n.lt.0.or.k.gt.n) return
    perm = mod(f(n)*invf(n-k),md)
    return
  end function perm
  integer(8) function comb(n,k)
    implicit none
    integer, intent(in) :: n, k
    comb = mod(perm(n,k)*invf(k),md)
    return
  end function comb
  function inv(n) result(y)
    implicit none
    integer(8), intent(in) :: n
    integer(8) :: a, b, x, y, t, q
    a = mod(n,md)
    b = md
    x = 0
    y = 1
    do while(b.ne.0_8)
      q = a/b
      t = b
      b = mod(a,b)
      a = t
      t = y
      y = x
      x = t-q*x
    end do
    do while (y.lt.0_8)
      y = y+md
    end do
    y = mod(y,md)
    return
  end function inv
end module mod_black_or_white
program black_or_white
  use mod_black_or_white
  implicit none
  integer :: b, w, i
  integer(8) :: x = 0_8, y = 0_8
  read(*,*) b, w
  call init(b+w)
  do i = 1, b+w
    write(*,'(i0)') mod(mod(md+1_8-x+y,md)*invp(1),md)
    x = mod(x+comb(i-1,b-1)*invp(i),md)
    y = mod(y+comb(i-1,w-1)*invp(i),md)
  end do
  stop
end program black_or_white