Problem: 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>.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmin(T &a, const T &b) {
  return a > b ? a = b, true : false;
}
template <typename T>
bool chmax(T &a, const T &b) {
  return a < b ? a = b, true : false;
}
const long long P = 1000000007;
long long qpow(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) (r *= a) %= P;
    (a *= a) %= P;
    b >>= 1;
  }
  return r;
}
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
const int maxN = 8000;
int R, a[4];
map<pair<int, int>, int> f;
int of[maxN];
vector<long long> G[maxN];
long long s[maxN], b[maxN];
int lb[maxN], rb[maxN];
int main() {
  cin >> R;
  for (int i = 0; i < 4; ++i) cin >> a[i];
  long long sum = accumulate(a, a + 4, 0);
  for (int i = 0; i < 4; ++i) a[i] = a[i] * qpow(sum, P - 2) % P;
  for (int x = -R - 10; x <= R + 10; ++x)
    for (int y = -R - 10; y <= R + 10; ++y)
      if (x * x + y * y <= R * R) f.emplace(pair<int, int>(x, y), f.size());
  int n = f.size();
  memset(G, 0, sizeof(G));
  for (auto p : f) {
    int x = p.first.first, y = p.first.second;
    int id = p.second;
    lb[id] = rb[id] = id;
    for (int i = 0; i < 4; ++i) {
      int nx = x + dx[i], ny = y + dy[i];
      if (nx * nx + ny * ny > R * R) continue;
      chmin(lb[id], f[pair<int, int>(nx, ny)]);
      chmax(rb[id], f[pair<int, int>(nx, ny)]);
    }
  }
  for (int i = 1; i < n; ++i) chmax(rb[i], rb[i - 1]);
  for (int i = n - 2; i >= 0; --i) chmin(lb[i], lb[i + 1]);
  for (auto p : f) {
    int x = p.first.first, y = p.first.second;
    int id = p.second;
    of[id] = lb[id];
    G[id].assign(rb[id] - lb[id] + 1, 0);
    G[id][id - of[id]] = 1;
    for (int i = 0; i < 4; ++i) {
      int nx = x + dx[i], ny = y + dy[i];
      if (nx * nx + ny * ny <= R * R) {
        (G[id][f[pair<int, int>(nx, ny)] - of[id]] -= a[i]) %= P;
      }
    }
    b[id] = 1;
  }
  for (int i = 0; i < n; ++i) {
    assert(G[i][i - of[i]] != 0);
    for (int j = i + 1; j < n; ++j)
      if (of[j] <= i) {
        long long coef = qpow(G[i][i - of[i]], P - 2) * G[j][i - of[j]] % P;
        if (coef == 0) continue;
        for (int k = i; k < of[i] + (int)G[i].size(); ++k)
          (G[j][k - of[j]] -= G[i][k - of[i]] * coef) %= P;
        (b[j] -= b[i] * coef) %= P;
      }
  }
  for (int i = n - 1; i >= 0; --i) {
    for (int j = i + 1; j < of[i] + (int)G[i].size(); ++j)
      (b[i] -= s[j] * G[i][j - of[i]]) %= P;
    s[i] = b[i] * qpow(G[i][i - of[i]], P - 2) % P;
  }
  long long ans = s[f[pair<int, int>(0, 0)]];
  ans = (ans % P + P) % P;
  cout << ans << endl;
  return 0;
}