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 N = 8131, md = 1e9 + 7;
int R, a1, a2, a3, a4, A[N][N], id[171][171], n, B[N];
inline int pow(int a, int b) {
  int ret = 1;
  for (; b; b >>= 1, a = (long long)a * a % md)
    if (b & 1) ret = (long long)ret * a % md;
  return ret;
}
void gauss() {
  for (int i = 1; i <= n; ++i) {
    int id = 0;
    for (int j = i; j <= n && !id; ++j)
      if (A[j][i] != 0) id = j;
    if (i != id) swap(A[i], A[id]), swap(B[i], B[id]);
    vector<int> pos;
    for (int j = i; j <= n; ++j)
      if (A[i][j]) pos.push_back(j);
    const int iv = pow(A[i][i], md - 2);
    for (int j = i + 1; j <= n; ++j)
      if (A[j][i]) {
        int dlt = md - (long long)A[j][i] * iv % md;
        for (int k : pos) A[j][k] = (A[j][k] + (long long)A[i][k] * dlt) % md;
        B[j] = (B[j] + (long long)B[i] * dlt) % md;
      }
  }
  for (int i = n; i; --i) {
    B[i] = (long long)B[i] * pow(A[i][i], md - 2) % md;
    for (int j = i - 1; j; --j)
      B[j] = (B[j] - (long long)B[i] * A[j][i] % md + md) % md;
  }
}
int main() {
  scanf("%d%d%d%d%d", &R, &a1, &a2, &a3, &a4);
  const int pp = pow(a1 + a2 + a3 + a4, md - 2);
  a1 = (long long)a1 * pp % md, a2 = (long long)a2 * pp % md,
  a3 = (long long)a3 * pp % md, a4 = (long long)a4 * pp % md;
  for (int i = -R - 1; i <= R + 1; ++i)
    for (int j = -R - 1; j <= R + 1; ++j) {
      int x = abs(i), y = abs(j);
      if (x * x + y * y <= R * R || (x - 1) * (x - 1) + y * y <= R * R ||
          x * x + (y - 1) * (y - 1) <= R * R)
        id[i + 72][j + 72] = ++n;
    }
  for (int i = -R - 1; i <= R + 1; ++i)
    for (int j = -R - 1; j <= R + 1; ++j)
      if (id[i + 72][j + 72]) {
        int* a = A[id[i + 72][j + 72]];
        if (i * i + j * j <= R * R) {
          a[id[i + 72][j + 72]] = md - 1;
          a[id[i + 71][j + 72]] = a1;
          a[id[i + 72][j + 71]] = a2;
          a[id[i + 73][j + 72]] = a3;
          a[id[i + 72][j + 73]] = a4;
          B[id[i + 72][j + 72]] = md - 1;
        } else {
          a[id[i + 72][j + 72]] = 1;
          B[id[i + 72][j + 72]] = 0;
        }
      }
  gauss();
  printf("%d\n", B[id[72][72]]);
  return 0;
}