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 long long mod = 1e9 + 7;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x * f;
}
int R, id[123][123], n, band;
long long p1, p2, p3, p4, sum;
int g[7846][7846], ans[7846];
vector<pair<int, int> > pos;
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
inline int Abs(int x) { return x >= 0 ? x : -x; }
void Guass(int n, int band) {
  for (int i = 1; i <= n; ++i) {
    if (!g[i][i]) {
      for (int j = i + 1; j <= min(n, i + band); ++j) {
        if (g[j][i]) {
          swap(g[i], g[j]);
          break;
        }
      }
    }
    if (!g[i][i]) continue;
    long long Inv = qpow(g[i][i], mod - 2);
    for (int j = i + 1; j <= min(i + band, n); ++j) {
      long long div = g[j][i] * Inv % mod;
      for (int k = i; k <= min(i + 2 * band, n); ++k) {
        g[j][k] = (g[j][k] - div * g[i][k] % mod + mod) % mod;
      }
      g[j][n + 1] = (g[j][n + 1] - div * g[i][n + 1] % mod + mod) % mod;
    }
  }
  for (int i = n; i >= 1; --i) {
    ans[i] = g[i][n + 1];
    for (int j = i + 1; j <= min(i + 2 * band, n); ++j) {
      ans[i] = (ans[i] - 1LL * g[i][j] * ans[j] % mod + mod) % mod;
    }
    ans[i] = ans[i] * qpow(g[i][i], mod - 2) % mod;
  }
}
int main() {
  R = read(), p1 = read(), p2 = read(), p3 = read(), p4 = read();
  sum = p1 + p2 + p3 + p4;
  sum = qpow(sum, mod - 2);
  p1 = p1 * sum % mod, p2 = p2 * sum % mod, p3 = p3 * sum % mod,
  p4 = p4 * sum % mod;
  for (int i = -R; i <= R; ++i) {
    for (int j = -R; j <= R; ++j) {
      if (i * i + j * j > R * R) continue;
      pos.push_back(make_pair(i, j));
      id[i + 50][j + 50] = pos.size();
    }
  }
  n = pos.size();
  band = 1;
  for (auto u : pos) {
    int x = u.first, y = u.second;
    g[id[x + 50][y + 50]][id[x + 50][y + 50]] = 1;
    g[id[x + 50][y + 50]][n + 1] = 1;
    if (id[x - 1 + 50][y + 50])
      g[id[x + 50][y + 50]][id[x - 1 + 50][y + 50]] = mod - p1,
                                               band = max(
                                                   band,
                                                   Abs(id[x + 50][y + 50] -
                                                       id[x - 1 + 50][y + 50]));
    if (id[x + 50][y - 1 + 50])
      g[id[x + 50][y + 50]][id[x + 50][y - 1 + 50]] = mod - p2,
                                               band = max(
                                                   band,
                                                   Abs(id[x + 50][y + 50] -
                                                       id[x + 50][y - 1 + 50]));
    if (id[x + 1 + 50][y + 50])
      g[id[x + 50][y + 50]][id[x + 1 + 50][y + 50]] = mod - p3,
                                               band = max(
                                                   band,
                                                   Abs(id[x + 50][y + 50] -
                                                       id[x + 1 + 50][y + 50]));
    if (id[x + 50][y + 1 + 50])
      g[id[x + 50][y + 50]][id[x + 50][y + 1 + 50]] = mod - p4,
                                               band = max(
                                                   band,
                                                   Abs(id[x + 50][y + 50] -
                                                       id[x + 50][y + 1 + 50]));
  }
  Guass(n, band);
  printf("%d\n", ans[id[0 + 50][0 + 50]]);
  return 0;
}