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;
int V, R, a, b, c, d, id[105][105], A[8005][8005], ans[8005];
int pow(int n, int m) {
  int s = n, ans = 1;
  while (m) {
    if (m & 1) ans = 1LL * ans * s % 1000000007;
    s = 1LL * s * s % 1000000007;
    m >>= 1;
  }
  return ans;
}
void guess() {
  for (int i = 1; i <= V; i++) {
    int x = pow(A[i][i], 1000000007 - 2);
    for (int j = i; j <= V + 1; j++) A[i][j] = 1LL * A[i][j] * x % 1000000007;
    for (int j = i + 1; j <= min(i + 2 * R, V); j++) {
      if (A[j][i]) {
        int x = A[j][i];
        for (int k = i; k <= min(i + 2 * R, V); k++)
          A[j][k] = (A[j][k] - 1LL * A[i][k] * x % 1000000007 + 1000000007) %
                    1000000007;
        A[j][V + 1] =
            (A[j][V + 1] - 1LL * A[i][V + 1] * x % 1000000007 + 1000000007) %
            1000000007;
      }
    }
  }
  for (int i = V; i; i--) {
    for (int j = i + 1; j <= V; j++)
      A[i][V + 1] =
          (A[i][V + 1] - 1LL * A[i][j] * ans[j] % 1000000007 + 1000000007) %
          1000000007;
    ans[i] = A[i][V + 1];
  }
}
int main() {
  scanf("%d%d%d%d%d", &R, &a, &b, &c, &d);
  int inv = pow(a + b + c + d, 1000000007 - 2);
  a = 1LL * a * inv % 1000000007, b = 1LL * b * inv % 1000000007,
  c = 1LL * c * inv % 1000000007, d = 1LL * d * inv % 1000000007;
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) id[i + R][j + R] = ++V;
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++) {
      if (i * i + j * j <= R * R) {
        int ii = i + R, jj = j + R;
        if ((i - 1) * (i - 1) + j * j <= R * R)
          A[id[ii][jj]][id[ii - 1][jj]] =
              (A[id[ii][jj]][id[ii - 1][jj]] + 1000000007 - a) % 1000000007;
        if (i * i + (j - 1) * (j - 1) <= R * R)
          A[id[ii][jj]][id[ii][jj - 1]] =
              (A[id[ii][jj]][id[ii][jj - 1]] + 1000000007 - b) % 1000000007;
        if ((i + 1) * (i + 1) + j * j <= R * R)
          A[id[ii][jj]][id[ii + 1][jj]] =
              (A[id[ii][jj]][id[ii + 1][jj]] + 1000000007 - c) % 1000000007;
        if (i * i + (j + 1) * (j + 1) <= R * R)
          A[id[ii][jj]][id[ii][jj + 1]] =
              (A[id[ii][jj]][id[ii][jj + 1]] + 1000000007 - d) % 1000000007;
      }
    }
  for (int i = 1; i <= V; i++) A[i][i] = A[i][V + 1] = 1;
  guess();
  printf("%d", ans[id[R][R]]);
}