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 const p = 1e9 + 7;
int pw(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = 1ll * res * x % p;
    x = 1ll * x * x % p;
    y >>= 1;
  }
  return res;
}
int a[105][105][105], f[105][105];
int main() {
  int r, p1, p2, p3, p4, inv, inv3;
  scanf("%d%d%d%d%d", &r, &p1, &p2, &p3, &p4);
  inv = pw((1ll * p1 + p2 + p3 + p4) % p, p - 2);
  p1 = 1ll * p1 * inv % p;
  p2 = 1ll * p2 * inv % p;
  p3 = 1ll * p3 * inv % p;
  p4 = 1ll * p4 * inv % p;
  inv3 = pw(p3, p - 2);
  for (int i = -r; i <= r; i++) {
    int s = -sqrt(r * r - i * i);
    a[s + r][i + r][i + r] = 1;
  }
  for (int i = -r; i <= r; i++) {
    int s = -sqrt(r * r - i * i), t = -s;
    for (int j = s; j <= t; j++) {
      for (int k = 0; k <= 2 * r + 1; k++) {
        a[i + 1 + r][j + r][k] =
            ((1ll * a[i + r][j + r][k] -
              (i == -r ? 0 : 1ll * p1 * a[i - 1 + r][j + r][k]) -
              1ll * p2 * a[i + r][j - 1 + r][k] -
              1ll * p4 * a[i + r][j + 1 + r][k]) %
                 p +
             p) %
            p;
        if (k == 2 * r + 1)
          a[i + 1 + r][j + r][k] += p - 1, a[i + 1 + r][j + r][k] %= p;
        a[i + 1 + r][j + r][k] = 1ll * a[i + 1 + r][j + r][k] * inv3 % p;
      }
    }
  }
  for (int i = -r; i <= r; i++) {
    int t = sqrt(r * r - i * i);
    for (int k = 0; k <= 2 * r; k++) f[i + r][k] = a[t + 1 + r][i + r][k];
    f[i + r][2 * r + 1] = (p - a[t + 1 + r][i + r][2 * r + 1]) % p;
  }
  for (int i = 0; i <= 2 * r; i++) {
    int maxx = i;
    for (int j = i + 1; j <= 2 * r; j++)
      if (f[j][i] > f[maxx][i]) maxx = j;
    for (int j = 0; j <= 2 * r + 1; j++) swap(f[i][j], f[maxx][j]);
    for (int j = 0; j <= 2 * r; j++) {
      if (j == i) continue;
      int tmp = 1ll * f[j][i] * pw(f[i][i], p - 2) % p;
      for (int k = i; k <= 2 * r + 1; k++)
        f[j][k] -= 1ll * tmp * f[i][k] % p, f[j][k] += p, f[j][k] %= p;
    }
  }
  int ans = 0;
  for (int i = 0; i <= 2 * r; i++)
    ans += 1ll * a[r][r][i] * f[i][2 * r + 1] % p * pw(f[i][i], p - 2) % p,
        ans %= p;
  ans += a[r][r][2 * r + 1], ans %= p;
  printf("%d", ans);
  return 0;
}