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 N = 55, MOD = 1e9 + 7;
const int MOV[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
int R, n, nid, D;
int inp[4], id[N * 2 + 10][N * 2 + 10], eid[N * N * 4][2], p[4],
    mat[8000][8000];
int f[N * N * 4];
int QPow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = int(1ll * res * a % MOD);
    a = int(1ll * a * a % MOD);
    b >>= 1;
  }
  return res;
}
void Gauss(int nequ, int nvar) {
  int equ = 1, var = 1;
  while (equ <= nequ && var <= nvar) {
    if (!mat[equ][var]) {
      printf("error\n");
      exit(1);
    }
    int k = QPow(mat[equ][var], MOD - 2);
    for (int i = var; i <= nvar && i <= var + D; i++)
      mat[equ][i] = int(1ll * mat[equ][i] * k % MOD);
    mat[equ][nvar + 1] = int(1ll * mat[equ][nvar + 1] * k % MOD);
    for (int i = equ + 1; i <= equ + D && i <= nequ; i++) {
      if (!mat[i][var]) continue;
      k = mat[i][var];
      for (int j = var; j <= nvar && j <= var + D; j++)
        mat[i][j] = int((mat[i][j] - 1ll * mat[equ][j] * k % MOD + MOD) % MOD);
      mat[i][nvar + 1] = int(
          (mat[i][nvar + 1] - 1ll * mat[equ][nvar + 1] * k % MOD + MOD) % MOD);
    }
    var++;
    equ++;
  }
}
void Calc(int nvar) {
  for (int i = nvar; i >= 1; i--) {
    for (int j = i + 1; j <= nvar && j <= i + D; j++) {
      mat[i][nvar + 1] =
          int((mat[i][nvar + 1] - 1ll * mat[i][j] * f[j] % MOD + MOD) % MOD);
      mat[i][j] = 0;
    }
    f[i] = mat[i][nvar + 1];
  }
}
int main() {
  scanf("%d", &R);
  int tot = 0;
  for (int i = 0; i < 4; i++) scanf("%d", &p[i]), tot += p[i];
  int bas = QPow(tot, MOD - 2);
  for (int i = 0; i < 4; i++) p[i] = int(1ll * p[i] * bas % MOD);
  for (int x = -R; x <= R; x++)
    for (int y = -R; y <= R; y++)
      if (x * x + y * y <= R * R) {
        id[x + N][y + N] = ++nid;
        eid[nid][0] = x;
        eid[nid][1] = y;
      }
  for (int i = 1; i <= nid; i++) {
    int x = eid[i][0], y = eid[i][1];
    mat[i][i] = MOD - 1;
    mat[i][nid + 1] = MOD - 1;
    for (int j = 0; j < 4; j++) {
      int x_ = x + MOV[j][0], y_ = y + MOV[j][1];
      if (id[x_ + N][y_ + N]) mat[i][id[x_ + N][y_ + N]] = p[j];
    }
  }
  D = R * 2 + 1;
  Gauss(nid, nid);
  Calc(nid);
  printf("%d\n", f[id[N][N]]);
  return 0;
}