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 P = 1000000007;
int id[110][110];
int x[7855];
int a[7855][7855];
int qpow(int x, int k, int ans = 1) {
  while (k) {
    if (k & 1) ans = 1ll * ans * x % P;
    x = 1ll * x * x % P;
    k >>= 1;
  }
  return ans;
}
int main() {
  int r, p1, p2, p3, p4, n = 0;
  scanf("%d%d%d%d%d", &r, &p1, &p2, &p3, &p4);
  const int d = r << 1, s = qpow(p1 + p2 + p3 + p4, P - 2);
  p1 = 1ll * p1 * s % P;
  p2 = 1ll * p2 * s % P;
  p3 = 1ll * p3 * s % P;
  p4 = 1ll * p4 * s % P;
  for (int i = -r; i <= r; ++i) {
    for (int j = -r; j <= r; ++j) {
      if (i * i + j * j <= r * r) {
        id[i + 51][j + 51] = ++n;
      }
    }
  }
  for (int i = -r; i <= r; ++i) {
    for (int j = -r; j <= r; ++j) {
      if (const int x = id[i + 51][j + 51]) {
        a[x][x] = P - 1;
        if (const int y = id[i + 50][j + 51]) a[x][y] = p1;
        if (const int y = id[i + 51][j + 50]) a[x][y] = p2;
        if (const int y = id[i + 52][j + 51]) a[x][y] = p3;
        if (const int y = id[i + 51][j + 52]) a[x][y] = p4;
        a[x][n + 1] = P - 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    const int t = P - qpow(a[i][i], P - 2), lim = (i + d) < n ? (i + d) : n;
    for (int j = i + 1; j <= lim; ++j) {
      if (const int s = a[j][i]) {
        const int r = 1ll * t * s % P;
        for (int k = i; k <= lim; ++k) {
          a[j][k] = (a[j][k] + 1ll * r * a[i][k]) % P;
        }
        a[j][n + 1] = (a[j][n + 1] + 1ll * r * a[i][n + 1]) % P;
      }
    }
  }
  for (int i = n; i >= 1; --i) {
    x[i] = a[i][n + 1];
    for (int j = i + 1; j <= n; ++j) {
      x[i] = (x[i] + 1ll * (P - x[j]) * a[i][j]) % P;
    }
    x[i] = qpow(a[i][i], P - 2, x[i]);
  }
  printf("%d\n", x[id[51][51]]);
  return 0;
}
