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 = 7846;
const long long mod = 1e9 + 7;
int a[N][N];
long long r, a1, a2, a3, a4;
long long pow(long long n, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = ans * n % mod;
    k >>= 1;
    n = n * n % mod;
  }
  return ans;
}
void print(int n) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n + 1; j++) {
      cout << (a[i][j] >= 1);
    }
    cout << endl;
  }
}
bool gauss(long long n) {
  long long del;
  for (int i = 1; i <= n; i++) {
    int k = i;
    del = a[i][i];
    for (int j = i; j <= min(n, i + 2 * r); j++)
      a[i][j] = 1LL * a[i][j] * pow(del, mod - 2) % mod;
    a[i][n + 1] = 1LL * a[i][n + 1] * pow(del, mod - 2) % mod;
    for (k = min(n / 2 + 1, 1LL * i + 1); k <= min(n, i + 2 * r); k++) {
      if (k != n / 2 + 1 && k < i) continue;
      if (k == i) continue;
      del = a[k][i];
      if (del == 0) continue;
      for (int j = i; j <= min(n, i + 2 * r); j++)
        a[k][j] = (1LL * a[k][j] - 1LL * a[i][j] * del % mod + mod) % mod;
      a[k][n + 1] =
          (1LL * a[k][n + 1] - 1LL * a[i][n + 1] * del % mod + mod) % mod;
    }
  }
  return true;
}
long long p[4];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int mp[110][110];
int main() {
  memset(a, 0, sizeof(a));
  cin >> r >> a1 >> a2 >> a3 >> a4;
  int cnt = 0;
  p[0] = a1 * pow(a1 + a2 + a3 + a4, mod - 2) % mod;
  p[1] = a2 * pow(a1 + a2 + a3 + a4, mod - 2) % mod;
  p[2] = a3 * pow(a1 + a2 + a3 + a4, mod - 2) % mod;
  p[3] = a4 * pow(a1 + a2 + a3 + a4, mod - 2) % mod;
  for (long long i = -r; i <= r; i++) {
    for (long long j = -r; j <= r; j++) {
      if (i * i + j * j > r * r) continue;
      mp[i + r][j + r] = ++cnt;
    }
  }
  for (long long i = -r; i <= r; i++) {
    for (long long j = -r; j <= r; j++) {
      if (i * i + j * j > r * r) continue;
      int u = mp[i + r][j + r];
      a[u][cnt + 1] = 1;
      a[u][u] = 1;
      for (int k = 0; k < 4; k++) {
        long long tx = i + dx[k], ty = j + dy[k];
        if (tx * tx + ty * ty > r * r) continue;
        int v = mp[tx + r][ty + r];
        a[u][v] = (-p[k] + mod) % mod;
      }
    }
  }
  gauss(cnt);
  cout << a[mp[r][r]][cnt + 1] << endl;
  return 0;
}