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 MOD = 1e9 + 7;
const int N = 110;
int F[N][N][N], G[N][N], H[N][N];
int r, al, ad, ar, au, ia;
int powi(int a, int b) {
  int c = 1;
  for (; b; b >>= 1, a = 1ll * a * a % MOD)
    if (b & 1) c = 1ll * c * a % MOD;
  return c;
}
int main() {
  scanf("%d%d%d%d%d", &r, &al, &ad, &ar, &au);
  ia = powi(al + ad + ar + au, MOD - 2);
  al = 1ll * al * ia % MOD;
  ad = 1ll * ad * ia % MOD;
  ar = 1ll * ar * ia % MOD;
  au = 1ll * au * ia % MOD;
  for (int x = 1; x <= r * 2 + 1; ++x)
    for (int y = 1; y <= r * 2 + 1; ++y)
      if ((x - (r + 1)) * (x - (r + 1)) + (y - (r + 1)) * (y - (r + 1)) <=
          r * r) {
        int Z = 1;
        for (int p = 1; p <= r * 2 + 1; ++p)
          for (int q = 1; q <= r * 2 + 1; ++q) H[p][q] = 0;
        H[x - 1][y] = al;
        H[x][y - 1] = ad;
        H[x + 1][y] = ar;
        H[x][y + 1] = au;
        for (int p = y; p <= r * 2 + 1; ++p) {
          Z = (Z + 1ll * F[x - 1][p][0] * H[x - 1][p]) % MOD;
          for (int q = 1; q <= p; ++q)
            H[x][q] = (H[x][q] + 1ll * F[x - 1][p][q] * H[x - 1][p]) % MOD;
          for (int q = p + 1; q <= r * 2 + 1; ++q)
            H[x - 1][q] =
                (H[x - 1][q] + 1ll * F[x - 1][p][q] * H[x - 1][p]) % MOD;
        }
        for (int p = 1; p < y; ++p) {
          Z = (Z + 1ll * F[x][p][0] * H[x][p]) % MOD;
          for (int q = 1; q <= p; ++q)
            H[x + 1][q] = (H[x + 1][q] + 1ll * F[x][p][q] * H[x][p]) % MOD;
          for (int q = p + 1; q <= r * 2 + 1; ++q)
            H[x][q] = (H[x][q] + 1ll * F[x][p][q] * H[x][p]) % MOD;
        }
        int k = powi(MOD + 1 - H[x][y], MOD - 2);
        for (int p = 1; p <= y; ++p) F[x][y][p] = 1ll * H[x + 1][p] * k % MOD;
        for (int p = y + 1; p <= r * 2 + 1; ++p)
          F[x][y][p] = 1ll * H[x][p] * k % MOD;
        F[x][y][0] = 1ll * Z * k % MOD;
      }
  for (int x = r * 2 + 1; x; --x)
    for (int y = r * 2 + 1; y; --y) {
      G[x][y] = F[x][y][0];
      for (int z = 0; z <= y; ++z)
        G[x][y] = (G[x][y] + 1ll * F[x][y][z] * G[x + 1][z]) % MOD;
      for (int z = y + 1; z <= r * 2 + 1; ++z)
        G[x][y] = (G[x][y] + 1ll * F[x][y][z] * G[x][z]) % MOD;
    }
  printf("%d\n", G[r + 1][r + 1]);
}