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>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
const long long mod = 1e9 + 7, G = 7850;
long long A[4], P[4];
vector<pair<int, int> > n;
int m[G][G];
int sz, R;
long long binpow(long long x, long long k) {
  long long o = 1;
  for (; k; k >>= 1) {
    if (k & 1) o = o * x % mod;
    x = x * x % mod;
  }
  return o;
}
long long mod_inv(long long x) { return binpow(x, mod - 2); }
int gauss(const int a) {
  pair<int, int> u[G];
  int szu = 0;
  for (int q = 0, w = 0; q < a && w < a; q++, w++) {
    int i = q;
    for (; i < a && !m[i][w];) i++;
    if (i != q) swap(m[i], m[q]);
    const long long k = mod_inv(m[q][w]);
    for (int e = w; e <= a; e++) m[q][e] = m[q][e] * k % mod;
    szu = 0;
    for (int e = w; e <= a; e++) {
      if (m[q][e]) u[szu++] = {e, m[q][e]};
    }
    const long long inv = mod_inv(m[q][w]);
    for (int e = q + 1; e < a; e++) {
      if (m[e][w] == 0) continue;
      const long long k = m[e][w] * inv;
      for (int r = 0; r < szu; r++) {
        const pair<int, int> p = u[r];
        m[e][p.first] -= k * p.second % mod;
        m[e][p.first] < 0 && (m[e][p.first] += mod);
      }
    }
  }
  for (int q = a - 1; q >= 0; q--) {
    for (int w = a - 1; w > q; w--) {
      m[q][a] -= 1LL * m[w][a] * m[q][w] % mod;
      if (m[q][a] < 0) m[q][a] += mod;
      m[q][w] = 0;
    }
  }
  return 1;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  ;
  cin >> R;
  for (int q = 0; q < 4; q++) cin >> A[q];
  for (int q = 0; q < 4; q++)
    P[q] = A[q] * mod_inv(A[0] + A[1] + A[2] + A[3]) % mod;
  for (int q = -100; q < 100; q++) {
    for (int w = -100; w < 100; w++) {
      if (q * q + w * w > R * R) continue;
      n.push_back({q, w});
    }
  }
  sz = n.size();
  sort(n.begin(), n.end());
  memset(m, 0, sizeof(m));
  ;
  for (int q = 0; q < sz; q++) {
    m[q][q] = 1;
    for (int e = 0; e < 4; e++) {
      int nx = n[q].first + dx[e], ny = n[q].second + dy[e];
      if (nx * nx + ny * ny <= R * R) {
        int num =
            lower_bound(n.begin(), n.end(), make_pair(nx, ny)) - n.begin();
        m[q][num] += mod - P[e];
        if (m[q][num] >= mod) m[q][num] -= mod;
      }
    }
    m[q][sz] = 1;
  }
  int res = gauss(sz);
  int num = find(n.begin(), n.end(), make_pair(0, 0)) - n.begin();
  cout << m[num][sz];
}
