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>
const int mod = 1e9 + 7;
int inv(int x) {
  if (x == 1) return 1;
  return (long long)(mod - mod / x) * inv(mod % x) % mod;
}
int r, a[10], p[10], G[8005][8005], R[8005], tl;
int dx[] = {0, -1, 0, +1, 0};
int dy[] = {0, 0, -1, 0, +1};
std::map<int, std::map<int, int> > id;
void Gaussian() {
  for (int i = 1; i <= tl; ++i) {
    int x = G[i][i];
    for (int j = i + 1; j <= tl && j <= i + 2 * r; ++j) {
      if (!G[j][i]) continue;
      int d = (long long)G[j][i] * inv(x) % mod;
      for (int k = i; k <= i + 2 * r && k <= tl; ++k)
        G[j][k] = (G[j][k] - (long long)G[i][k] * d % mod + mod) % mod;
      R[j] = (R[j] - (long long)R[i] * d % mod + mod) % mod;
    }
  }
  for (int i = tl; i >= 1; i--) {
    for (int j = i + 1; j <= tl; ++j)
      R[i] = (R[i] - (long long)G[i][j] * R[j] % mod + mod) % mod;
    R[i] = (long long)R[i] * inv(G[i][i]) % mod;
  }
}
int main() {
  scanf("%d%d%d%d%d", &r, &a[1], &a[2], &a[3], &a[4]);
  int sum = a[1] + a[2] + a[3] + a[4];
  for (int i = 1; i <= 4; ++i) p[i] = (long long)a[i] * inv(sum) % mod;
  for (int i = -50; i <= 50; ++i) {
    for (int j = -50; j <= 50; ++j) {
      if (i * i + j * j > r * r) continue;
      if (!id[i][j]) id[i][j] = ++tl;
    }
  }
  for (int i = -50; i <= 50; ++i) {
    for (int j = -50; j <= 50; ++j) {
      if (i * i + j * j > r * r) continue;
      G[id[i][j]][id[i][j]] = 1;
      R[id[i][j]] = 1;
      for (int k = 1; k <= 4; ++k) {
        int x = i + dx[k], y = j + dy[k];
        if (x * x + y * y > r * r) continue;
        G[id[i][j]][id[x][y]] = mod - p[k];
      }
    }
  }
  Gaussian();
  printf("%d", R[id[0][0]]);
  return 0;
}