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 N = 102, p = 1e9 + 7;
int r, a, b, c, d, e, tot, cnt, opt, w[N], q[N][N], f[N][N][N];
int fl[N][N];
inline int pows(long long u, int v) {
  long long ans = 1;
  while (v > 0) {
    if (v & 1) ans = ans * u % p;
    u = u * u % p, v = v >> 1;
  }
  return ans;
}
inline int inc(int a, int b) {
  if (a + b >= p) return a + b - p;
  return a + b;
}
inline int sub(int a, int b) {
  if (a - b < 0) return a - b + p;
  return a - b;
}
inline int mul(int a, int b) { return 1ll * a * b % p; }
inline void gauss() {
  memset(w, 0, sizeof(w));
  for (int i = 1; i <= tot; i++) {
    for (int c = i; c <= tot; c++) {
      if (!q[c][i]) continue;
      for (int x = 0; x <= tot; x++) swap(q[i][x], q[c][x]);
      break;
    }
    int inv = pows(q[i][i], p - 2);
    for (int c = i + 1; c <= tot; c++) {
      int t = mul(q[c][i], inv);
      for (int x = 0; x <= tot; x++) q[c][x] = sub(q[c][x], mul(t, q[i][x]));
    }
  }
  for (int i = tot; i >= 0; i--) {
    int ans = q[i][0];
    for (int x = i + 1; x <= tot; x++) ans = sub(ans, mul(q[i][x], w[x]));
    ans = mul(ans, pows(q[i][i], p - 2)), w[i] = ans;
  }
}
int main() {
  cin >> r >> a >> b >> d >> c, e = a + b + c + d;
  a = mul(a, pows(e, p - 2)), b = mul(b, pows(e, p - 2));
  c = mul(c, pows(e, p - 2)), d = mul(d, pows(e, p - 2));
  for (int i = -r; i <= r; i++)
    for (int j = -r; j <= r; j++)
      if (i * i + j * j <= r * r) fl[i + r][j + r] = 1;
  for (int j = -r; j <= r; j++)
    for (int i = -r; i <= r; i++)
      if (i * i + j * j <= r * r) {
        f[i + r][j + r][++tot] = 1, fl[i + r][j + r] = 2;
        break;
      }
  for (int i = -r; i <= r; i++)
    for (int j = -r; j <= r; j++)
      if (fl[i + r][j + r] == 1) {
        for (int k = 0; k <= tot; k++) w[k] = f[i + r - 1][j + r][k];
        for (int k = 0; k <= tot; k++)
          if (i + r - 2 >= 0) w[k] = sub(w[k], mul(f[i + r - 2][j + r][k], d));
        for (int k = 0; k <= tot; k++)
          w[k] = sub(w[k], mul(f[i + r - 1][j + r - 1][k], b));
        for (int k = 0; k <= tot; k++)
          w[k] = sub(w[k], mul(f[i + r - 1][j + r + 1][k], c));
        if (i - 1 == 0 && j == 0) w[0] = p - 1;
        int wn = pows(a, p - 2);
        for (int k = 0; k <= tot; k++) f[i + r][j + r][k] = mul(w[k], wn);
      }
  for (int j = r; j >= -r; j--)
    for (int i = r; i >= -r; i--)
      if (i * i + j * j <= r * r) {
        cnt++;
        for (int k = 0; k <= tot; k++) w[k] = f[i + r][j + r][k];
        for (int k = 0; k <= tot; k++)
          w[k] = sub(w[k], mul(f[i + r - 1][j + r][k], d));
        for (int k = 0; k <= tot; k++)
          w[k] = sub(w[k], mul(f[i + r][j + r - 1][k], b));
        for (int k = 0; k <= tot; k++)
          w[k] = sub(w[k], mul(f[i + r][j + r + 1][k], c));
        w[0] = sub(0, w[0]);
        if (i == 0 && j == 0) w[0] = inc(w[0], 1);
        for (int k = 0; k <= tot; k++) q[cnt][k] = w[k];
        break;
      }
  gauss();
  for (int i = -r; i <= r; i++)
    for (int j = -r; j <= r; j++) {
      opt = inc(opt, f[i + r][j + r][0]);
      for (int k = 1; k <= tot; k++)
        opt = inc(opt, mul(f[i + r][j + r][k], w[k]));
    }
  cout << opt << endl;
}