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 C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <bits/stdc++.h>

using namespace std;

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

template<typename T>
bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T, size_t size>
void fill(T (&ary)[size], const T &val) {
    fill_n((T *) ary, size, val);
}

class combination {
private:
    bool has_inited = false;
    i64 p;

    i64 extgcd(i64 a, i64 b, i64 &x, i64 &y) {
        i64 d = a;
        if (b != 0) {
            d = extgcd(b, a % b, y, x);
            y -= (a / b) * x;
        } else {
            x = 1;
            y = 0;
        }
        return d;
    }

    i64 mod_inverse(i64 a, i64 m) {
        i64 x, y;
        if (extgcd(a, m, x, y) == 1) return (x + m) % m;
        return 0;
    }

    vector<i64> fact, ifact;

    void init_fact(i64 n, i64 m) {
        fact.resize(n + 1);
        ifact.resize(n + 1);
        fact[0] = fact[1] = 1;
        ifact[0] = ifact[1] = 1;
        for (i64 i = 2; i <= n; ++i) {
            fact[i] = (i * fact[i - 1]) % m;
            ifact[i] = mod_inverse(fact[i], m);
        }
    }

public:
    combination(i64 p) : p(p) {}

    combination(i64 n, i64 p) {
        init(n, p);
    }

    /*
     * n以下の階乗の値を前計算する
     * O(nlog(p))
     */
    void init(i64 n, i64 p) {
        has_inited = true;
        this->p = p;
        init_fact(n, p);
    }

    /*
     * 階乗の値を前計算しておいた場合はO(1)
     * 前計算していない場合はO(k+log(p))
     * */
    i64 comb(i64 n, i64 k) {
        if (n < 0 or k < 0 or n < k) return 0;
        if (has_inited) return fact[n] * ifact[n - k] % p * ifact[k] % p;

        i64 num = 1, den = 1;
        for (i64 i = 0; i < k; ++i) {
            num = num * ((n - i) % p) % p;
            den = den * (i + 1) % p;
        }
        return num * mod_inverse(den, p) % p;
    }
};

template<class T>
class segtree {
public:
    int n, size_;
    vector<T> dat, sum;  //区間の和,区間に一様に足された値
    segtree() = default;

    segtree(int size, T x) { init(size, x); }

    void init(int size, T x) {
        size_ = size;
        n = 1;
        while (n < size_) n *= 2;
        dat.assign(2 * n - 1, 0);
        sum.assign(2 * n - 1, 0);
        add(0, size, x);
    }

    int size() const { return size_; }

    void add(int a, int b, T x) { add(a, b, x, 0, 0, n); }

    T add(int a, int b, T x, int k, int l, int r) {
        if (b <= l or r <= a) return dat[k];
        if (a <= l and r <= b) {
            sum[k] += x;
            return dat[k] += x * (r - l);
        }
        int m = (l + r) / 2;
        return dat[k] = add(a, b, x, 2 * k + 1, l, m) + add(a, b, x, 2 * k + 2, m, r) + sum[k] * (r - l);
    }

    T query(int a, int b) { return query(a, b, 0, 0, n); }

    T query(int a, int b, int k, int l, int r) {
        if (b <= l or r <= a) return 0;
        if (a <= l and r <= b) return dat[k];
        int m = (l + r) / 2;
        return query(a, b, 2 * k + 1, l, m) + query(a, b, 2 * k + 2, m, r) + sum[k] * (min(r, b) - max(l, a));
    }

    T at(int i) {
        return query(i, i + 1);
    }

    void update(int i, T x) {
        add(i, i + 1, -at(i) + x);
    }
};

template<i64 p>
class Fp {
public:
    i64 x;

    Fp() : x(0) {}

    Fp(i64 x_) : x((x_ % p + p) % p) {}

    Fp operator+() const { return Fp(x); }

    Fp operator-() const { return Fp(-x); }

    Fp &operator+=(const Fp &y) {
        x = ((x + y.x) % p + p) % p;
        return *this;
    }

    Fp &operator-=(const Fp &y) { return *this += -y; }

    Fp &operator*=(const Fp &y) {
        x = x * y.x % p;
        return *this;
    }

    Fp &operator/=(const Fp &y) { return *this *= Fp(inverse(y.x)); }

    Fp operator+(const Fp &y) const { return Fp(x) += y; }

    Fp operator-(const Fp &y) const { return Fp(x) -= y; }

    Fp operator*(const Fp &y) const { return Fp(x) *= y; }

    Fp operator/(const Fp &y) const { return Fp(x) /= y; }

    bool operator==(const Fp &y) const { return x == y.x; }

    bool operator!=(const Fp &y) const { return !(*this == y); }

    i64 extgcd(i64 a, i64 b, i64 &x, i64 &y) {
        i64 d = a;
        if (b != 0) {
            d = extgcd(b, a % b, y, x);
            y -= (a / b) * x;
        } else {
            x = 1;
            y = 0;
        }
        return d;
    }

    i64 inverse(i64 a) {
        i64 x, y;
        extgcd(a, p, x, y);
        return (x % p + p) % p;
    }
};

void solve() {
    constexpr i64 mod = 1'000'000'007;

    i64 B, W;
    cin >> B >> W;

    constexpr i64 ma = 200010;

    vector<Fp<mod>> pow2(ma), ipow2(ma);
    pow2[0] = 1;
    ipow2[0] = 1;
    rep(i, 1, pow2.size()) {
        pow2[i] = pow2[i - 1] * 2;
        ipow2[i] = Fp<mod>(1) / pow2[i];
    }

    combination c(ma, mod);
    segtree<Fp<mod>> ans(B + W, 0);

    rep(i, B - 1, B + W - 1) {
        {
            Fp<mod> p=ipow2[i+1]*c.comb((i+1)-1,B-1);
            ans.add(i,i+1,p);
        }
        {
            Fp<mod> p = ipow2[i + 1] * c.comb((i + 1) - 2, B - 2);
            ans.add(0, i, p);
        }
    }

    rep(k, 1, B + 1) {
        {
            Fp<mod> p = ipow2[B + W - k] * c.comb(B + W - (k + 1), B - k);
            ans.add(B + W - k, B + W, p);
        }
        if(k<B){
            Fp<mod> p = ipow2[B + W - k] * c.comb(B + W - (k + 1) - 1, B - k - 1);
            ans.add(0, B + W - k - 1, p);
        }
    }

    rep(i, 0, B + W) {
        cout << ans.query(i, i + 1).x << endl;
    }
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}