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;
namespace BlueQuantum {
int const N = 1e2 + 5, mod = 1e9 + 7, shf = 51;
int n, R, p1, p2, p3, p4;
int lim[N], a[N][N], k[N][N][N], C[N][N];
inline long long qpow(long long base, int exp) {
  long long res = 1;
  while (exp) {
    if (exp & 1) res = res * base % mod;
    base = base * base % mod;
    exp >>= 1;
  }
  return res;
}
int add(int a, int b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
  cout << a << '\n';
  return a;
}
int sub(int a, int b) {
  a -= b;
  if (a < 0) {
    a += mod;
  }
  cout << a << '\n';
  return a;
}
inline void solve(int n) {
  for (int i = 1; i <= n; ++i) {
    if (a[i][i] == 0)
      for (int j = i + 1; j <= n; ++j)
        if (a[j][i]) {
          swap(a[i], a[j]);
          break;
        }
    long long inv = qpow(a[i][i], mod - 2);
    for (int j = i; j <= n + 1; ++j) a[i][j] = inv * a[i][j] % mod;
    for (int j = i + 1, t = a[j][i]; j <= n; ++j, t = a[j][i])
      for (int k = i; k <= n + 1; ++k)
        if ((a[j][k] -= (long long)a[i][k] * t % mod) < 0) a[j][k] += mod;
  }
  for (int i = n; i > 1; --i)
    for (int j = 1; j < i; ++j)
      if ((a[j][n + 1] -= (long long)a[i][n + 1] * a[j][i] % mod) < 0)
        a[j][n + 1] += mod;
}
inline int main() {
  cin >> R >> p1 >> p2 >> p3 >> p4;
  long long inv = qpow(p1 + p2 + p3 + p4, mod - 2);
  p1 = p1 * inv % mod, p2 = p2 * inv % mod, p3 = p3 * inv % mod,
  p4 = p4 * inv % mod;
  for (int i = -R; i <= R; ++i) {
    lim[i + shf] = int(sqrt(R * R - i * i) + 1);
    k[shf - lim[i + shf] + 1][i + shf][i + R] = 1;
  }
  inv = qpow(p3, mod - 2);
  for (int i = -R + 1; i <= R + 1; ++i) {
    for (int j = -R; j <= R; ++j) {
      if (i > -lim[j + shf] + 1 && i <= lim[j + shf]) {
        for (int l = 0; l <= 2 * R; ++l) {
          if ((k[i + shf][j + shf][l] =
                   (k[i - 1 + shf][j + shf][l] -
                    (long long)p1 * k[i - 2 + shf][j + shf][l] % mod -
                    (long long)p2 * k[i - 1 + shf][j - 1 + shf][l] % mod -
                    (long long)p4 * k[i - 1 + shf][j + 1 + shf][l] % mod) %
                   mod) < 0)
            k[i + shf][j + shf][l] += mod;
          k[i + shf][j + shf][l] = inv * k[i + shf][j + shf][l] % mod;
        }
        C[i + shf][j + shf] =
            ((C[i - 1 + shf][j + shf] -
              (long long)p1 * C[i - 2 + shf][j + shf] % mod -
              (long long)p2 * C[i - 1 + shf][j - 1 + shf] % mod -
              (long long)p4 * C[i - 1 + shf][j + 1 + shf] % mod - 1) %
                 mod +
             mod) *
            inv % mod;
      }
    }
  }
  for (int i = -R; i <= R; ++i) {
    for (int l = 0; l <= 2 * R; ++l)
      a[i + R + 1][l + 1] = k[shf + lim[i + shf]][i + shf][l];
    a[i + R + 1][2 * R + 2] = mod - C[shf + lim[i + shf]][i + shf];
  }
  solve(2 * R + 1);
  int ans = 0;
  for (int l = 0; l <= 2 * R; ++l)
    if ((ans += (long long)k[shf][shf][l] * a[l + 1][2 * R + 2] % mod) >= mod)
      ans -= mod;
  if ((ans += C[shf][shf]) >= mod) ans -= mod;
  cout << ans;
  return 0;
}
}  // namespace BlueQuantum
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}