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>.
#include <bits/stdc++.h>
const int MAXN = 1e2 + 7;
const long long HA = 1e9 + 7;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int n;
int idx[MAXN][MAXN], cnt, a[8003][8003];
long long p[4];
long long fp(long long a, long long b = HA - 2) {
  long long r = 1;
  while (b) {
    if (b & 1) r = r * a % HA;
    b >>= 1, a = a * a % HA;
  }
  return r;
}
void gauss() {
  n <<= 1;
  for (int i = (1); i <= (cnt); ++i) {
    long long d = fp(1ll * a[i][i]);
    for (int j = i, t = 0; j <= cnt && t <= n; t++, j++)
      a[i][j] = 1ll * a[i][j] * d % HA;
    a[i][0] = 1ll * a[i][0] * d % HA;
    for (int j = i + 1, t1 = 0; j <= cnt && t1 <= n; j++, t1++) {
      d = a[j][i];
      if (!d) continue;
      for (int k = i, t2 = 0; k <= cnt && t2 <= n; k++, t2++)
        a[j][k] = 1ll * (1ll * a[j][k] + HA - 1ll * d * a[i][k] % HA) % HA;
      a[j][0] = 1ll * (1ll * a[j][0] + HA - 1ll * d * a[i][0] % HA) % HA;
    }
  }
  for (int i = (cnt); i >= (1); --i)
    for (int j = (i + 1); j <= (cnt); ++j)
      a[i][0] = 1ll * (1ll * a[i][0] + HA - 1ll * a[j][0] * a[i][j] % HA) % HA;
}
int main() {
  scanf("%d", &n);
  long long sum = 0;
  for (int i = (0); i <= (3); ++i)
    scanf("%lld", p + i), sum = (sum + p[i]) % HA;
  sum = fp(sum);
  for (int i = (0); i <= (3); ++i) p[i] = p[i] * sum % HA;
  for (int x = (-n); x <= (n); ++x)
    for (int y = (n); y >= (-n); --y)
      if (x * x + y * y <= n * n) idx[x + 50][y + 50] = ++cnt;
  for (int x = (-n); x <= (n); ++x)
    for (int y = (n); y >= (-n); --y) {
      if (int f = idx[x + 50][y + 50]) {
        a[f][f] = -1;
        a[f][0] = -1;
        int t;
        for (int k = (0); k <= (3); ++k) {
          int tx = x + dx[k];
          int ty = y + dy[k];
          if (idx[tx + 50][ty + 50]) a[f][idx[tx + 50][ty + 50]] = p[k];
        }
      }
    }
  gauss();
  printf("%lld\n", 1ll * (a[idx[0 + 50][0 + 50]][0] % HA + HA) % HA);
  return 0;
}
