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 ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;
const int N = 7890;
int mul(int a, int b) { return ((ll)a * b % MOD + MOD) % MOD; }
int add(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
int pow(int a, int b) {
  if (b == 0) return 1;
  int c = pow(a, b / 2);
  c = mul(c, c);
  if (b % 2 == 1) c = mul(c, a);
  return c;
}
int inv(int a) { return pow(a, MOD - 2); }
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int R, p[4];
int mat[N][N];
int n;
int idx[101][101];
int b[N];
vector<int> nz;
void row_reduce(int x, int y) {
  int times = mul(inv(mat[x][x]), -mat[y][x]);
  b[y] = add(b[y], mul(times, b[x]));
  for (auto p : nz) {
    mat[y][p] = add(mat[y][p], mul(times, mat[x][p]));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> R;
  int s = 0;
  for (int i = 0; i < (4); ++i) {
    cin >> p[i];
    s += p[i];
  }
  int s_inv = inv(s);
  for (int i = 0; i < (4); ++i) p[i] = mul(p[i], s_inv);
  n = 0;
  for (int i = (-R); i <= (R); ++i)
    for (int j = (-R); j <= (R); ++j)
      if (i * i + j * j <= R * R) idx[i + R][j + R] = n++;
  for (int i = (-R); i <= (R); ++i)
    for (int j = (-R); j <= (R); ++j)
      if (i * i + j * j <= R * R) {
        for (int d = 0; d < (4); ++d) {
          int ii = i + dx[d];
          int jj = j + dy[d];
          if (ii * ii + jj * jj <= R * R)
            mat[idx[i + R][j + R]][idx[ii + R][jj + R]] = p[d];
        }
        mat[idx[i + R][j + R]][idx[i + R][j + R]] = MOD - 1;
        b[idx[i + R][j + R]] = MOD - 1;
      }
  for (int x = 0; x < (n); ++x) {
    nz.clear();
    for (int z = 0; z < (n); ++z)
      if (mat[x][z] != 0) nz.push_back(z);
    for (auto y : nz)
      if (x != y) row_reduce(x, y);
  }
  for (int x = 0; x < (n); ++x)
    if (x != idx[R][R]) {
      nz.clear();
      for (int z = 0; z < (n); ++z)
        if (mat[x][z] != 0) nz.push_back(z);
      row_reduce(x, idx[R][R]);
    }
  int ans = mul(b[idx[R][R]], inv(mat[idx[R][R]][idx[R][R]]));
  cout << ans << endl;
  return 0;
}