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;
const int cmd = 1e9 + 7;
const int N = 7845 + 5;
int R, n, a[4], Mat[N][N], p[4];
pair<int, int> pnt[N];
map<pair<int, int>, int> f;
int fpow(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % cmd)
    if (b & 1) res = 1ll * res * a % cmd;
  return res;
}
void Gauss(int band) {
  for (int i = 1; i <= n; i++) {
    if (Mat[i][i] == 0) {
      bool flag = true;
      for (int j = i + 1; j <= min(n, j + band); j++)
        if (Mat[j][i]) {
          for (int k = i; k <= min(n, j + band * 2); k++)
            swap(Mat[i][k], Mat[j][k]);
          swap(Mat[i][n + 1], Mat[j][n + 1]);
          break;
        }
      if (flag) continue;
    }
    int inv = fpow(Mat[i][i], cmd - 2);
    for (int j = i + 1; j <= min(n, i + band); j++)
      if (Mat[j][i]) {
        int x = 1ll * Mat[j][i] * inv % cmd;
        for (int k = i; k <= min(n, i + band * 2); k++)
          Mat[j][k] = (Mat[j][k] - 1ll * Mat[i][k] * x % cmd + cmd) % cmd;
        Mat[j][n + 1] =
            (Mat[j][n + 1] - 1ll * Mat[i][n + 1] * x % cmd + cmd) % cmd;
      }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = i + 1; j <= n; j++)
      Mat[i][n + 1] =
          (Mat[i][n + 1] - 1ll * Mat[j][n + 1] * Mat[i][j] % cmd + cmd) % cmd;
    Mat[i][n + 1] = 1ll * Mat[i][n + 1] * fpow(Mat[i][i], cmd - 2) % cmd;
    if (make_pair(0, 0) == pnt[i]) return;
  }
}
int main() {
  scanf("%d%d%d%d%d", &R, &a[0], &a[1], &a[2], &a[3]);
  for (int i = 0; i < 4; i++)
    p[i] = 1ll * a[i] * fpow(a[0] + a[1] + a[2] + a[3], cmd - 2) % cmd;
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) f[pnt[++n] = make_pair(i, j)] = n;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    pair<int, int> cur = pnt[i], t;
    Mat[i][i] = Mat[i][n + 1] = -1;
    if (f[t = make_pair(cur.first - 1, cur.second)]) {
      mx = max(mx, abs(i - f[t]));
      Mat[i][f[t]] = p[0];
    }
    if (f[t = make_pair(cur.first + 1, cur.second)]) {
      mx = max(mx, abs(i - f[t]));
      Mat[i][f[t]] = p[2];
    }
    if (f[t = make_pair(cur.first, cur.second - 1)]) {
      mx = max(mx, abs(i - f[t]));
      Mat[i][f[t]] = p[1];
    }
    if (f[t = make_pair(cur.first, cur.second + 1)]) {
      mx = max(mx, abs(i - f[t]));
      Mat[i][f[t]] = p[3];
    }
  }
  Gauss(mx);
  printf("%d", Mat[f[make_pair(0, 0)]][n + 1]);
  return 0;
}