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 Mod = 1e9 + 7;
int add(int a, int b) { return a + b >= Mod ? a + b - Mod : a + b; }
int dec(int a, int b) { return a - b < 0 ? a - b + Mod : a - b; }
int mul(int a, int b) { return 1ll * a * b % Mod; }
void Add(int &a, int b) { a = add(a, b); }
void Dec(int &a, int b) { a = dec(a, b); }
void Mul(int &a, int b) { a = mul(a, b); }
int ksm(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, Mul(a, a))
    if (b & 1) Mul(ans, a);
  return ans;
}
const int N = 105;
int R, p1, p2, p3, p4;
int lm[N], k[N][N][N], b[N][N], a[N][N];
int main() {
  cin >> R >> p1 >> p2 >> p3 >> p4;
  int s = p1 + p2 + p3 + p4;
  s = ksm(s, Mod - 2);
  Mul(p1, s), Mul(p2, s), Mul(p3, s), Mul(p4, s);
  int T = R + 2;
  for (int i = -R; i <= R; i++) {
    lm[i + T] = sqrt(R * R - i * i);
    k[T - lm[i + T]][i + T][i + R] = 1;
  }
  int ip3 = ksm(p3, Mod - 2);
  for (int i = -R + 1; i <= R + 1; i++)
    for (int j = -R; j <= R; j++)
      if (i > -lm[j + T] && i <= lm[j + T] + 1) {
        for (int l = 0; l <= 2 * R; l++) {
          int &c = k[i + T][j + T][l];
          c = k[i + T - 1][j + T][l];
          Dec(c, mul(p2, k[i + T - 1][j + T - 1][l]));
          Dec(c, mul(p4, k[i + T - 1][j + T + 1][l]));
          Dec(c, mul(p1, k[i + T - 2][j + T][l]));
          Mul(c, ip3);
        }
        int &c = b[i + T][j + T];
        c = b[i + T - 1][j + T];
        Dec(c, mul(p2, b[i + T - 1][j + T - 1]));
        Dec(c, mul(p4, b[i + T - 1][j + T + 1]));
        Dec(c, mul(p1, b[i + T - 2][j + T]));
        Dec(c, 1), Mul(c, ip3);
      }
  for (int i = -R; i <= R; i++) {
    for (int l = 0; l <= 2 * R; l++)
      a[i + R][l] = k[T + lm[i + T] + 1][i + T][l];
    a[i + R][R * 2 + 1] = dec(0, b[T + lm[i + T] + 1][i + T]);
  }
  int n = 2 * R;
  for (int i = 0; i <= n; i++) {
    int k = i;
    while (!a[k][i] && k < n) ++k;
    if (k ^ i) swap(a[i], a[k]);
    int iv = ksm(a[i][i], Mod - 2);
    for (int j = i + 1; j <= n; j++) {
      int co = mul(a[j][i], iv);
      for (int k = i; k <= n + 1; k++) Dec(a[j][k], mul(a[i][k], co));
    }
  }
  for (int i = n; ~i; i--) {
    Mul(a[i][n + 1], ksm(a[i][i], Mod - 2));
    for (int j = i - 1; ~j; j--) Dec(a[j][n + 1], mul(a[j][i], a[i][n + 1]));
  }
  int ans = b[T][T];
  for (int i = 0; i <= n; i++) Add(ans, mul(k[T][T][i], a[i][n + 1]));
  cout << ans;
  return 0;
}