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 maxn = 203;
const int maxm = 251;
const int mod = 1E9 + 7;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
int R, A[4], N, X[maxn][maxn], cx;
long long S[7850][maxm], V[7850];
int dis2(int x1, int y1, int x2, int y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
bool valid(int x, int y) {
  if (x < 0 || x > maxn) return false;
  if (y < 0 || y > maxn) return false;
  return X[x][y];
}
long long Pow(long long v, int p) {
  long long ret = 1;
  while (p) {
    if (p & 1) ret = (ret * v) % mod;
    p >>= 1;
    v = (v * v) % mod;
  }
  return ret;
}
long long Div(long long a, long long b) { return (a * Pow(b, mod - 2)) % mod; }
long long T[maxm], TV;
void GS() {
  for (int i = 1; i <= cx; ++i) {
    assert(S[i][N] != 0);
    for (int j = N; j < maxm; ++j) T[j] = Div(S[i][j], S[i][N]);
    TV = Div(V[i], S[i][N]);
    for (int j = i + 1; j <= cx && j <= i + N; ++j)
      if (S[j][i - j + N]) {
        for (int k = 0; k < j - i; ++k) assert(S[i][k] == 0);
        for (int k = max(j - i, N + 1); k < maxm; ++k) {
          S[j][i + k - j] -= (T[k] * S[j][i - j + N]) % mod;
          if (S[j][i + k - j] < 0) S[j][i + k - j] += mod;
        }
        V[j] -= (TV * S[j][i - j + N]) % mod;
        if (V[j] < 0) V[j] += mod;
        S[j][i - j + N] = 0;
      }
  }
  for (int i = cx; i; --i) {
    TV = Div(V[i], S[i][N]);
    for (int j = i - 1; j && j > i + N - maxm; --j) {
      V[j] -= (S[j][i - j + N] * TV) % mod;
      if (V[j] < 0) V[j] += mod;
      S[j][i - j + N] = 0;
    }
  }
}
int main() {
  scanf("%d%d%d%d%d", &R, A, A + 1, A + 2, A + 3);
  int tot = A[0] + A[1] + A[2] + A[3];
  for (int i = 0; i < 4; ++i) {
    A[i] = Div(A[i], tot);
  }
  N = R * 2;
  for (int i = 0; i <= N; ++i) {
    for (int j = 0; j <= N; ++j) {
      if (dis2(i, j, R, R) <= R * R) X[i][j] = ++cx;
    }
  }
  for (int i = 0; i <= N; ++i) {
    for (int j = 0; j <= N; ++j) {
      if (X[i][j]) {
        V[X[i][j]] = 1;
        S[X[i][j]][N] = 1;
        for (int ix = 0; ix < 4; ++ix) {
          int ni = i + dx[ix], nj = j + dy[ix];
          if (!valid(ni, nj)) continue;
          S[X[i][j]][X[ni][nj] - X[i][j] + N] = mod - A[ix];
        }
      }
    }
  }
  GS();
  cout << Div(V[X[R][R]], S[X[R][R]][N]) << endl;
}