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 w[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
int R, a[4], rp[4], tmp, n, sz, id[110][110], fr, p[10010][110], slv[110][110],
    num[110], val[110], mn, pl, ans;
int POW(int x, int y) {
  int tot = 1;
  while (y)
    y& 1 ? tot = 1ll * tot * x % mod : 0, x = 1ll * x * x % mod, y >>= 1;
  return tot;
}
void Solve() {
  for (int i = 1; i <= n; ++i) {
    if (!slv[i][i]) {
      for (int j = i + 1; j <= n; ++j)
        if (slv[j][i]) {
          for (int k = 1; k <= n; ++k) swap(slv[i][k], slv[j][k]);
          swap(num[i], num[j]);
          break;
        }
    }
    for (int j = i + 1; j <= n; ++j) {
      mn = (-1ll * slv[j][i] * POW(slv[i][i], mod - 2) % mod + mod) % mod;
      for (int k = i; k <= n; ++k)
        slv[j][k] = (slv[j][k] + 1ll * mn * slv[i][k]) % mod;
      num[j] = (num[j] + 1ll * mn * num[i]) % mod;
    }
  }
  for (int i = n; i >= 1; --i) {
    mn = num[i];
    for (int j = i + 1; j <= n; ++j)
      mn = ((mn - 1ll * slv[i][j] * val[j]) % mod + mod) % mod;
    val[i] = 1ll * mn * POW(slv[i][i], mod - 2) % mod;
  }
}
int main() {
  scanf("%d%d%d%d%d", &R, &a[0], &a[1], &a[2], &a[3]),
      n = (R << 1) + 1, tmp = POW(a[0] + a[1] + a[2] + a[3], mod - 2),
      pl = R + 1;
  for (int i = 0; i < 4; ++i)
    a[i] = 1ll * a[i] * tmp % mod, rp[i] = POW(a[i], mod - 2);
  for (int i = -R; i <= R; ++i) {
    for (int j = -R; j <= 0; ++j)
      if (((j) * (j) + (i) * (i) <= R * R)) {
        id[j + pl][i + pl] = ++sz, p[sz][i + pl] = 1;
        break;
      }
  }
  for (int i = -R; i <= R; ++i)
    for (int j = R; j >= -R; --j)
      if ((fr = id[i + pl][j + pl]) &&
          ((i + 1) * (i + 1) + (j) * (j) <= R * R)) {
        id[i + 1 + pl][j + pl] = ++sz;
        for (int k = 1; k <= n; ++k) {
          p[sz][k] = p[fr][k];
          for (int wy = 0; wy < 4; ++wy)
            if (wy != 2)
              p[sz][k] = ((p[sz][k] -
                           1ll * a[wy] *
                               p[id[i + w[wy][0] + pl][j + w[wy][1] + pl]][k]) %
                              mod +
                          mod) %
                         mod;
          p[sz][k] = 1ll * p[sz][k] * rp[2] % mod;
        }
        p[sz][n + 1] = p[fr][n + 1];
        for (int wy = 0; wy < 4; ++wy)
          if (wy != 2)
            p[sz][n + 1] =
                ((p[sz][n + 1] -
                  1ll * a[wy] *
                      p[id[i + w[wy][0] + pl][j + w[wy][1] + pl]][n + 1]) %
                     mod +
                 mod) %
                mod;
        p[sz][n + 1] = 1ll * (p[sz][n + 1] - 1 + mod) * rp[2] % mod;
      }
  for (int i = -R; i <= R; ++i)
    for (int j = R; j >= 0; --j)
      if (((i) * (i) + (j) * (j) <= R * R)) {
        for (int k = 1; k <= n; ++k) slv[i + pl][k] = p[id[j + pl][i + pl]][k];
        for (int k = 1; k <= n; ++k)
          for (int wy = 0; wy < 4; ++wy) {
            slv[i + pl][k] =
                ((slv[i + pl][k] -
                  1ll * a[wy] *
                      p[id[j + w[wy][0] + pl][i + w[wy][1] + pl]][k]) %
                     mod +
                 mod) %
                mod;
          }
        num[i + pl] = mod - p[id[j + pl][i + pl]][n + 1];
        for (int wy = 0; wy < 4; ++wy)
          num[i + pl] =
              (num[i + pl] +
               1ll * a[wy] *
                   p[id[j + w[wy][0] + pl][i + w[wy][1] + pl]][n + 1]) %
              mod;
        num[i + pl] = (num[i + pl] + 1) % mod;
        break;
      }
  Solve(), val[n + 1] = 1;
  for (int i = 1; i <= n + 1; ++i)
    ans = (ans + 1ll * p[id[pl][pl]][i] * val[i]) % mod;
  printf("%d", ans);
  return 0;
}