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>
#pragma GCC optimize("Ofast")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int DIM = 105;
const int VMX = 7905;
const int MOD = 1000000007;
int pos[DIM][DIM], sys[VMX][VMX], res[VMX];
inline int logPow(int x, int n, int ans = 1) {
  for (; n; n >>= 1) {
    if (n & 1) ans = 1LL * ans * x % MOD;
    x = 1LL * x * x % MOD;
  }
  return ans;
}
inline int f(int x, int y) { return pos[x + DIM / 2][y + DIM / 2]; }
int main(void) {
  int r, p1, p2, p3, p4, s;
  cin >> r >> p1 >> p2 >> p3 >> p4;
  s = p1 + p2 + p3 + p4;
  int pb1 = 1LL * p1 * logPow(s, MOD - 2) % MOD,
      pb2 = 1LL * p2 * logPow(s, MOD - 2) % MOD,
      pb3 = 1LL * p3 * logPow(s, MOD - 2) % MOD,
      pb4 = 1LL * p4 * logPow(s, MOD - 2) % MOD;
  int cnt = 0;
  for (int i = -r; i <= r; ++i)
    for (int j = -r; j <= r; ++j)
      if (i * i + j * j <= r * r) pos[i + DIM / 2][j + DIM / 2] = ++cnt;
  for (int i = -r; i <= r; ++i)
    for (int j = -r; j <= r; ++j) {
      if (i * i + j * j > r * r) continue;
      sys[f(i, j)][f(i, j)] = sys[f(i, j)][cnt + 1] = 1;
      if (f(i - 1, j)) sys[f(i, j)][f(i - 1, j)] = (MOD - pb1) % MOD;
      if (f(i, j + 1)) sys[f(i, j)][f(i, j + 1)] = (MOD - pb2) % MOD;
      if (f(i + 1, j)) sys[f(i, j)][f(i + 1, j)] = (MOD - pb3) % MOD;
      if (f(i, j - 1)) sys[f(i, j)][f(i, j - 1)] = (MOD - pb4) % MOD;
    }
  for (int i = 1; i <= cnt; ++i) {
    int lim = min(i + r * 2, cnt);
    for (int j = i; j <= lim; ++j)
      if (sys[j][i]) {
        for (int k = i; k <= lim; ++k) swap(sys[i][k], sys[j][k]);
        swap(sys[i][cnt + 1], sys[j][cnt + 1]);
        break;
      }
    if (!sys[i][i]) continue;
    int inv = logPow(sys[i][i], MOD - 2);
    for (int k = i; k <= lim; ++k) sys[i][k] = 1LL * sys[i][k] * inv % MOD;
    sys[i][cnt + 1] = 1LL * sys[i][cnt + 1] * inv % MOD;
    for (int j = i + 1; j <= lim; ++j) {
      sys[j][cnt + 1] =
          (sys[j][cnt + 1] - 1LL * sys[i][cnt + 1] * sys[j][i] % MOD + MOD) %
          MOD;
      for (int k = lim; k >= i; --k)
        sys[j][k] = (sys[j][k] - 1LL * sys[i][k] * sys[j][i] % MOD + MOD) % MOD;
    }
  }
  for (int i = cnt; i >= 1; --i) {
    res[i] = sys[i][cnt + 1];
    for (int j = i + 1; j <= cnt; ++j)
      res[i] = (res[i] - 1LL * res[j] * sys[i][j] % MOD + MOD) % MOD;
    res[i] = 1LL * res[i] * logPow(sys[i][i], MOD - 2) % MOD;
  }
  cout << res[f(0, 0)];
  return 0;
}