A chip was placed on a field with coordinate system onto point (0, 0).

Every second the chip moves randomly. If the chip is currently at a point (x, y), after a second it moves to the point (x - 1, y) with probability p1, to the point (x, y - 1) with probability p2, to the point (x + 1, y) with probability p3 and to the point (x, y + 1) with probability p4. It's guaranteed that p1 + p2 + p3 + p4 = 1. The moves are independent.

Find out the expected time after which chip will move away from origin at a distance greater than R (i.e. <image> will be satisfied).

Input

First line contains five integers R, a1, a2, a3 and a4 (0 ≤ R ≤ 50, 1 ≤ a1, a2, a3, a4 ≤ 1000).

Probabilities pi can be calculated using formula <image>.

Output

It can be shown that answer for this problem is always a rational number of form <image>, where <image>.

Print P·Q - 1 modulo 109 + 7. 

Examples

Input

0 1 1 1 1


Output

1

Input

1 1 1 1 1


Output

666666674

Input

1 1 2 1 2


Output

538461545

Note

In the first example initially the chip is located at a distance 0 from origin. In one second chip will move to distance 1 is some direction, so distance to origin will become 1.

Answers to the second and the third tests: <image> and <image>.
#include <bits/stdc++.h>
using namespace std;
const int defX[4] = {-1, 0, +1, 0};
const int defY[4] = {0, -1, 0, +1};
long long p[4];
const int maxN = 103;
const long long mod = 1000000007;
const int limit = maxN * 1.1;
long long poww(long long a, long long b) {
  long long ans = 1;
  a %= mod;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return ans;
}
struct ec {
  vector<pair<int, long long> > coef;
  long long sum;
  ec(vector<pair<int, long long> > _c, long long _s) {
    coef = _c;
    sum = _s;
  }
  ec() {
    coef = {};
    sum = 0;
  }
  void operator*=(long long x) {
    sum = (sum * x) % mod;
    for (auto& e : coef) e.second = (e.second * x) % mod;
  }
  void operator+=(ec who) {
    static vector<pair<int, long long> > aux;
    int p1, p2;
    sum = (sum + who.sum) % mod;
    aux = coef;
    coef.clear();
    for (p1 = p2 = 0; p1 < aux.size() && p2 < who.coef.size();) {
      if (aux[p1].first == who.coef[p2].first) {
        coef.push_back(make_pair(aux[p1].first,
                                 (aux[p1].second + who.coef[p2].second) % mod));
        if (coef.back().second == 0) coef.pop_back();
        p1++;
        p2++;
      } else {
        if (aux[p1].first < who.coef[p2].first) {
          coef.push_back(aux[p1]);
          p1++;
        } else {
          coef.push_back(who.coef[p2]);
          p2++;
        }
      }
    }
    while (p1 < aux.size()) {
      coef.push_back(aux[p1]);
      p1++;
    }
    while (p2 < who.coef.size()) {
      coef.push_back(who.coef[p2]);
      p2++;
    }
  }
};
struct gauss {
  vector<ec> data;
  vector<long long> sol;
  void solve() {
    int i, j, act;
    long long aux;
    sol.clear();
    for (i = 0; i < data.size(); i++) {
      aux = poww(data[i].coef[0].second, mod - 2);
      data[i] *= aux;
      for (j = i + 1; j < data.size() && j - i <= limit; j++) {
        if (data[j].coef[0].first != data[i].coef[0].first) continue;
        aux = poww(data[j].coef[0].second, mod - 2);
        aux = (mod - aux) % mod;
        data[j] *= aux;
        data[j] += data[i];
      }
    }
    sol.resize(data.size());
    for (i = data.size() - 1; i >= 0; i--) {
      act = data[i].coef[0].first;
      sol[act] = data[i].sum;
      for (j = 1; j < data[i].coef.size(); j++)
        sol[act] =
            (sol[act] + mod -
             ((data[i].coef[j].second * sol[data[i].coef[j].first]) % mod)) %
            mod;
    }
  }
};
long long R, i, j, d, a1, a2, a3, a4, aux, act, sz, id;
vector<pair<int, long long> > act_ec;
gauss work;
int main() {
  cin >> R >> a1 >> a2 >> a3 >> a4;
  aux = poww(a1 + a2 + a3 + a4, mod - 2);
  p[0] = (a1 * aux) % mod;
  p[1] = (a2 * aux) % mod;
  p[2] = (a3 * aux) % mod;
  p[3] = (a4 * aux) % mod;
  act = -1;
  sz = 2 * R + 3;
  for (i = -R - 1; i <= R + 1; i++) {
    for (j = -R - 1; j <= R + 1; j++) {
      act++;
      act_ec.clear();
      if (i == 0 && j == 0) id = act;
      if (i * i + j * j > R * R) {
        act_ec.push_back(make_pair(act, 1LL));
        work.data.push_back((ec){act_ec, 0});
        continue;
      }
      act_ec.push_back(make_pair(act, 1LL));
      act_ec.push_back(make_pair(act - sz, mod - p[0]));
      act_ec.push_back(make_pair(act - 1, mod - p[1]));
      act_ec.push_back(make_pair(act + sz, mod - p[2]));
      act_ec.push_back(make_pair(act + 1, mod - p[3]));
      sort(act_ec.begin(), act_ec.end());
      work.data.push_back({act_ec, 1LL});
    }
  }
  work.solve();
  printf("%lld", work.sol[id]);
  return 0;
}
