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 long long mod = 1e9 + 7;
const int maxr = 233;
const int I = 111;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
long long pow(long long a, long long n) {
  long long b = 1;
  while (n) {
    if (n & 1) (b *= a) %= mod;
    n >>= 1;
    (a *= a) %= mod;
  }
  return b;
}
long long R, a[4];
long long f[maxr * maxr][maxr], g[maxr * maxr];
int id[maxr][maxr];
int ct;
long long gauss() {
  for (int i = 0; i < ct; i++) {
    if (!f[i][I]) continue;
    long long inv = pow(f[i][I], mod - 2);
    for (int j = 0; j < I; j++) (f[i][j + I] *= inv) %= mod;
    (g[i] *= inv) %= mod;
    for (int k = i + 1; k <= i + I && k < ct; k++)
      if (f[k][I - k + i]) {
        long long t = (mod - f[k][I - k + i]) % mod;
        for (int j = 0; j < I; j++)
          (f[k][I - k + i + j] += t * f[i][I + j]) %= mod;
        (g[k] += t * g[i]) %= mod;
      }
  }
  for (int i = ct - 1; i >= 0; i--)
    if (f[i][I]) {
      for (int k = i - 1; k > 0 && k >= i - I; k--)
        if (f[k][I + i - k]) (g[k] -= f[k][I + i - k] * g[i]) %= mod;
      if (i == id[R][R]) return g[i];
      if (i < id[R][R]) break;
    }
  return 0;
}
int main() {
  cin >> R >> a[0] >> a[1] >> a[2] >> a[3];
  long long p = pow(a[0] + a[1] + a[2] + a[3], mod - 2);
  for (int i = 0; i <= 3; i++) (a[i] *= p) %= mod;
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) id[i + R][j + R] = ct++;
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) {
        int d = id[i + R][j + R];
        f[d][I] = 1;
        g[d] = 1;
        for (int k = 0; k <= 3; k++) {
          int x = i + dx[k], y = j + dy[k];
          if (x * x + y * y <= R * R)
            f[d][I - d + id[x + R][y + R]] = mod - a[k];
        }
      }
  long long ans = gauss();
  (ans += mod) %= mod;
  cout << ans << endl;
  return 0;
}