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>
#pragma GCC optimize(3)
using namespace std;
const int MOD = 1000000007;
int r, tot, a[5], b[8150][8150], p[5];
int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
map<pair<int, int>, int> q;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    (x *= 10) += ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long fast_power(long long x, long long k) {
  int res = 1;
  while (k) {
    if (k & 1) res = 1ll * res * x % MOD;
    x = 1ll * x * x % MOD;
    k >>= 1;
  }
  return res;
}
inline bool in_map(int x, int y) { return !(abs(x * x + y * y) > r * r); }
inline bool onedge(int x, int y) {
  if (in_map(x, y)) return 0;
  for (register int i = 0; i < 4; i++) {
    int xx = x + dx[i], yy = y + dy[i];
    if (in_map(xx, yy)) return 1;
  }
  return 0;
}
void gauss() {
  int inv;
  for (register int i = 1; i <= tot; i++) {
    inv = fast_power(b[i][i], MOD - 2);
    for (register int j = i + 1; j <= tot + 1; j++)
      b[i][j] = 1ll * b[i][j] * inv % MOD;
    b[i][i] = 1;
    for (register int j = i + 1, lim = min(tot, i + 2 + 2 * r); j <= lim; j++) {
      for (register int k = i + 1, lim = min(tot, i + 2 + 2 * r); k <= lim; k++)
        b[j][k] = (b[j][k] - 1ll * b[j][i] * b[i][k] % MOD + MOD) % MOD;
      b[j][tot + 1] =
          (b[j][tot + 1] - 1ll * b[j][i] * b[i][tot + 1] % MOD + MOD) % MOD;
      b[j][i] = 0;
    }
  }
  for (register int i = tot; i >= 1; i--)
    for (register int j = tot; j > i; j--)
      b[i][tot + 1] =
          (b[i][tot + 1] - 1ll * b[i][j] * b[j][tot + 1] % MOD + MOD) % MOD,
                 b[i][j] = 0;
}
void init() {
  for (register int i = -r - 1; i <= r + 1; i++)
    for (register int j = -r - 1; j <= r + 1; j++)
      if (onedge(i, j) || in_map(i, j)) q[make_pair(i, j)] = ++tot;
  for (register int i = 1; i <= 4; i++)
    p[i] = 1ll * a[i] *
           fast_power(((long long)a[1] + a[2] + a[3] + a[4]) % MOD, MOD - 2) %
           MOD;
  for (register int i = -r - 1; i <= r + 1; i++)
    for (register int j = -r - 1; j <= r + 1; j++) {
      if (onedge(i, j))
        b[q[make_pair(i, j)]][q[make_pair(i, j)]] = 1;
      else if (in_map(i, j)) {
        long long sum = 0;
        for (register int k = 0; k < 4; k++) {
          int x = dx[k] + i, y = dy[k] + j;
          sum = 1ll * (sum + p[k + 1]) % MOD;
          b[q[make_pair(i, j)]][q[make_pair(x, y)]] = p[k + 1];
        }
        b[q[make_pair(i, j)]][tot + 1] = MOD - sum;
        b[q[make_pair(i, j)]][q[make_pair(i, j)]] = MOD - 1;
      }
    }
}
signed main() {
  r = read();
  for (register int i = 1; i <= 4; i++) a[i] = read();
  init();
  gauss();
  printf("%d\n", b[q[make_pair(0, 0)]][tot + 1]);
  return 0;
}