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 = 205;
int r, p1, p2, p3, p4, ip3, n, ans, sum, isum, p;
int lim[N], f[N][N][N], g[N][N], h[N];
inline int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
inline int mul(int a, int b) { return 1ll * a * b % mod; }
inline int qpow(int a, int b) {
  int c = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) c = mul(a, c);
  return c;
}
inline void gauss() {
  for (int i = 1; i <= n; i++) {
    int r = 0;
    for (int j = i; j <= n; j++)
      if (f[j][i] != 0) {
        r = j;
        break;
      }
    if (i != r) swap(g[i], g[r]);
    int inv = qpow(g[i][i], mod - 2);
    for (int j = i; j <= n + 1; j++) g[i][j] = mul(g[i][j], inv);
    for (int j = i + 1; j <= n; j++) {
      for (int k = i + 1; k <= n + 1; k++)
        g[j][k] = add(g[j][k], mod - mul(g[j][i], g[i][k]));
      g[j][i] = 0;
    }
  }
  for (int i = n; i >= 1; i--) {
    h[i] = g[i][n + 1];
    for (int j = i + 1; j <= n; j++) h[i] = add(h[i], mod - mul(h[j], g[i][j]));
  }
}
int main() {
  cin >> r >> p1 >> p2 >> p3 >> p4;
  p = r + 5;
  sum = p1 + p2 + p3 + p4;
  sum %= mod;
  isum = qpow(sum, mod - 2);
  p1 = mul(p1, isum), p2 = mul(p2, isum), p3 = mul(p3, isum),
  p4 = mul(p4, isum);
  ip3 = qpow(p3, mod - 2), n = r + r + 1;
  for (int i = -r; i <= r; i++)
    lim[i + p] = int(sqrt(r * r - i * i) + 1),
            f[p - lim[i + p] + 1][i + p][i + r] = 1;
  for (int i = -r + 1; i <= r + 1; i++) {
    for (int j = -r; j <= r; j++) {
      if (i > -lim[j + p] + 1 && i <= lim[j + p]) {
        for (int k = 0; k <= n; k++) {
          f[i + p][j + p][k] =
              mul(ip3, add(f[i - 1 + p][j + p][k],
                           mod - (1ll * mul(p1, f[i - 2 + p][j + p][k]) +
                                  1ll * mul(p2, f[i - 1 + p][j - 1 + p][k]) +
                                  1ll * mul(p4, f[i - 1 + p][j + 1 + p][k])) %
                                     mod));
        }
        f[i + p][j + p][n] = add(f[i + p][j + p][n], mod - ip3);
      }
    }
  }
  for (int i = -r; i <= r; i++) {
    for (int j = 0; j < n; j++) {
      g[i + r + 1][j + 1] = f[p + lim[i + p]][i + p][j];
    }
    g[i + r + 1][n + 1] = mod - f[p + lim[i + p]][i + p][n];
    if (g[i + r + 1][n + 1] == mod) g[i + r + 1][n + 1] = 0;
  }
  gauss();
  for (int i = 1; i <= n; i++) ans = add(ans, mul(h[i], f[p][p][i - 1]));
  ans = add(ans, f[p][p][n]);
  cout << ans;
  return 0;
}