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;
long long read() {
  long long x = 0, F = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') F = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x * F;
}
int add(int a, int b) {
  return (a + b >= 1000000007) ? a + b - 1000000007 : a + b;
}
int dec(int a, int b) { return (a - b < 0) ? a - b + 1000000007 : a - b; }
int mul(int a, int b) { return 1LL * a * b % 1000000007; }
int fst_pow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
int inv(int a) { return fst_pow(a, 1000000007 - 2); }
int R, sump, cnt, p[100 + 5];
int id[100 + 5][100 + 5], fun[8000 + 5][8000 + 5], ans[8000 + 5], D;
int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
pair<int, int> pos[100 * 100 + 5];
double pabs(double x) { return (x < 0) ? -x : x; }
int Gauss(int m, int n) {
  int r = 1, c = 1;
  for (; r <= m && c <= n; r++, c++) {
    if (!fun[r][c]) return -1;
    int v = inv(fun[r][c]);
    for (int i = c; i <= min(c + D, n); i++) fun[r][i] = mul(fun[r][i], v);
    fun[r][n + 1] = mul(fun[r][n + 1], v);
    for (int i = r + 1; i <= min(r + D, m); i++)
      if (fun[i][c]) {
        v = fun[i][c];
        for (int j = c; j <= min(c + D, n); j++)
          fun[i][j] = dec(fun[i][j], mul(fun[r][j], v));
        fun[i][n + 1] = dec(fun[i][n + 1], mul(fun[r][n + 1], v));
      }
  }
  for (int i = r; i <= m; i++)
    if (fun[i][n + 1]) return -1;
  if (c < n) return n - c;
  for (int i = n; i >= 1; i--) {
    int v = fun[i][n + 1];
    for (int j = i + 1; j <= min(n, i + D); j++)
      v = dec(v, mul(ans[j], fun[i][j]));
    ans[i] = v;
  }
  return 0;
}
int main() {
  R = read();
  for (int i = 0; i < 4; i++) p[i] = read(), sump += p[i];
  for (int i = 0; i < 4; i++) p[i] = mul(p[i], inv(sump));
  for (int i = -R; i <= R; i++)
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) {
        id[i + 50][j + 50] = ++cnt;
        pos[cnt] = pair<int, int>(i, j);
      }
  for (int i = 1; i <= cnt; i++) {
    fun[i][i] = dec(0, 1), fun[i][cnt + 1] = dec(0, 1);
    for (int k = 0; k < 4; k++) {
      int nx = pos[i].first + dx[k], ny = pos[i].second + dy[k];
      if (id[nx + 50][ny + 50]) fun[i][id[nx + 50][ny + 50]] = p[k];
    }
  }
  D = (R << 1) + 1;
  Gauss(cnt, cnt);
  printf("%d", ans[id[50][50]]);
}