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 = 111;
const int MO = 1e9 + 7;
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int AD(int& x, int y) {
  x += y;
  if (x >= MO) x -= MO;
  if (x < 0) x += MO;
}
int mul(int x, int y) { return (long long)x * y % MO; }
int fpow(int x, int y = MO - 2) {
  if (!y) return 1;
  int z = fpow(x, y >> 1);
  z = mul(z, z);
  if (y & 1) return mul(z, x);
  return z;
}
int r, p[4], q[4], e[N][N];
int m, a[N][N][N], t[N];
int n, b[N][N], c[N], d[N];
int main() {
  int i, j, k, x, y, z;
  cin >> r;
  x = 0;
  for (i = 0; i < 4; i = i + 1) cin >> p[i], x += p[i];
  for (i = 0; i < 4; i = i + 1) p[i] = mul(p[i], fpow(x)), q[i] = fpow(p[i]);
  for (i = -r; i <= r; i = i + 1) {
    x = 0;
    for (j = -r; j <= r; j = j + 1) {
      if (i * i + j * j <= r * r) {
        e[i + r][j + r] = 1;
        if (!x) {
          m++;
          a[i + r][j + r][m] = 1;
        }
        x++;
      }
    }
  }
  for (j = 0; j <= r + r; j = j + 1) {
    for (i = 0; i <= r + r; i = i + 1) {
      if (!e[i][j]) continue;
      for (k = 0; k <= m; k = k + 1) t[k] = a[i][j][k];
      for (z = 0; z < 3; z = z + 1) {
        x = i + dx[z], y = j + dy[z];
        if (x >= 0 && y >= 0 && e[x][y]) {
          for (k = 0; k <= m; k = k + 1) AD(t[k], -mul(p[z], a[x][y][k]));
        }
      }
      AD(t[0], -1);
      if (e[i][j + 1]) {
        for (k = 0; k <= m; k = k + 1) a[i][j + 1][k] = mul(t[k], q[3]);
      } else {
        n++;
        for (k = 0; k <= m; k = k + 1) b[n][k] = t[k];
      }
    }
  }
  for (j = 1; j <= m; j = j + 1) {
    for (i = 1; i <= n; i = i + 1)
      if (b[i][j] && !c[i]) break;
    if (i > n) continue;
    x = fpow(b[i][j]);
    for (k = 0; k <= m; k = k + 1) b[i][k] = mul(b[i][k], x);
    z = i;
    c[z] = j;
    for (i = 1; i <= n; i = i + 1) {
      x = b[i][j];
      if (i == z || !x) continue;
      for (k = 0; k <= m; k = k + 1) AD(b[i][k], -mul(b[z][k], x));
    }
  }
  d[0] = 1;
  for (i = 1; i <= n; i = i + 1) d[c[i]] = MO - b[i][0];
  x = 0;
  for (k = 0; k <= m; k = k + 1) AD(x, mul(a[r][r][k], d[k]));
  cout << x;
  return 0;
}