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>
const int MAXR = 50;
const int MAXS = MAXR * MAXR * 3.15;
const int MOD = 1000000007;
int Pow(int x, int y) {
  int ret = 1;
  while (y) {
    if (y & 1) ret = (long long)ret * x % MOD;
    y >>= 1;
    x = (long long)x * x % MOD;
  }
  return ret;
}
void Prod(int &x, int y) { x = (long long)x * y % MOD; }
void Sub(int &x, int y) {
  x -= y;
  if (x < 0) x += MOD;
}
double Dist(std::pair<int, int> x, std::pair<int, int> y) {
  return sqrt((x.first - y.first) * (x.first - y.first) +
              (x.second - y.second) * (x.second - y.second));
}
int R, P1, P2, P3, P4;
int Pos[MAXR * 2 + 5][MAXR * 2 + 5];
std::vector<std::pair<int, int> > P;
int A[MAXS + 5][MAXS + 5], Dp[MAXS + 5];
int main() {
  scanf("%d%d%d%d%d", &R, &P1, &P2, &P3, &P4);
  int totInv = Pow(P1 + P2 + P3 + P4, MOD - 2);
  Prod(P1, totInv), Prod(P2, totInv), Prod(P3, totInv), Prod(P4, totInv);
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++)
      if (Dist(std::make_pair(i, j), std::make_pair(0, 0)) <= R) {
        Pos[(i) + MAXR + 1][(j) + MAXR + 1] = P.size() + 1;
        P.push_back(std::make_pair(i, j));
      }
  int N = P.size();
  for (int i = 0; i < N; i++) {
    int x = P[i].first, y = P[i].second;
    A[Pos[(x) + MAXR + 1][(y) + MAXR + 1]][N + 1] = 1;
    A[Pos[(x) + MAXR + 1][(y) + MAXR + 1]]
     [Pos[(x) + MAXR + 1][(y) + MAXR + 1]] = 1;
    A[Pos[(x) + MAXR + 1][(y) + MAXR + 1]]
     [Pos[(x - 1) + MAXR + 1][(y) + MAXR + 1]] = MOD - P1;
    A[Pos[(x) + MAXR + 1][(y) + MAXR + 1]]
     [Pos[(x) + MAXR + 1][(y - 1) + MAXR + 1]] = MOD - P2;
    A[Pos[(x) + MAXR + 1][(y) + MAXR + 1]]
     [Pos[(x + 1) + MAXR + 1][(y) + MAXR + 1]] = MOD - P3;
    A[Pos[(x) + MAXR + 1][(y) + MAXR + 1]]
     [Pos[(x) + MAXR + 1][(y + 1) + MAXR + 1]] = MOD - P4;
  }
  for (int i = 1; i <= N; i++) {
    std::vector<int> Not0;
    int tmp = Pow(A[i][i], MOD - 2);
    for (int j = i; j <= N + 1; j++) {
      Prod(A[i][j], tmp);
      if (A[i][j]) Not0.push_back(j);
    }
    for (int j = i + 1; j <= N; j++) {
      tmp = A[j][i];
      if (tmp)
        for (int k = 0; k < int(Not0.size()); k++)
          Sub(A[j][Not0[k]], (long long)A[i][Not0[k]] * tmp % MOD);
    }
  }
  for (int i = N; i >= 1; i--) {
    Dp[i] = A[i][N + 1];
    for (int j = i + 1; j <= N; j++)
      Sub(Dp[i], (long long)A[i][j] * Dp[j] % MOD);
  }
  printf("%d", Dp[Pos[(0) + MAXR + 1][(0) + MAXR + 1]]);
  return 0;
}