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 mod = 1000000007;
int qpow(int x, int k) {
  return k == 0 ? 1
                : 1ll * (k & 1 ? x : 1) * qpow(1ll * x * x % mod, k >> 1) % mod;
}
int R, a[4];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
vector<pair<int, pair<int, int> > > con[10111];
void adde(int x, int y, int p, int l) {
  con[x].push_back(make_pair(y, make_pair(p, l)));
}
void erase(int x, int c) {
  swap(con[x][c], con[x][con[x].size() - 1]);
  con[x].resize(con[x].size() - 1);
}
int id[111][111], tot;
long long dpp[10111], dpl[10111];
long long mpp[10111], mpl[10111];
bool vis[10111];
int V[2333], vn;
void solve2(int x, int du) {
  vn = 0;
  vis[x] = 1;
  for (int i = 0; i < con[x].size(); i++) {
    int u = con[x][i].first;
    if (u != du) {
      mpp[u] += con[x][i].second.first;
      mpl[u] += con[x][i].second.second;
      V[vn++] = u;
    } else {
      for (int j = 0; j < con[du].size(); j++) {
        int v = con[du][j].first;
        long long p =
            1ll * con[x][i].second.first * con[du][j].second.first % mod;
        mpp[v] += p;
        mpl[v] += (1ll * con[x][i].second.second * con[du][j].second.first +
                   1ll * con[x][i].second.first * con[du][j].second.second) %
                  mod;
        V[vn++] = v;
      }
    }
  }
  vector<pair<int, pair<int, int> > > ncon;
  for (int i = 0; i < vn; i++) {
    int u = V[i];
    if (mpp[u] != 0 || mpl[u] != 0) {
      ncon.push_back(make_pair(u, make_pair(mpp[u] % mod, mpl[u] % mod)));
      mpp[u] = mpl[u] = 0;
    }
  }
  con[x].swap(ncon);
}
void solve(int _x, int _y) {
  int X = id[_x][_y];
  long long selfp = 0, selfl = 0;
  for (int i = 0; i < con[X].size(); i++) {
    int u = con[X][i].first;
    if (u == X) {
      selfp += con[X][i].second.first;
      selfl += con[X][i].second.second;
    }
  }
  vector<pair<int, pair<int, int> > > ncon;
  selfp %= mod;
  selfl %= mod;
  assert(selfp != 1);
  long long inv = qpow(1 + mod - selfp, mod - 2);
  long long c = inv * selfl % mod;
  for (int i = 0; i < con[X].size(); i++) {
    int u = con[X][i].first;
    if (u != X) {
      ncon.push_back(make_pair(
          con[X][i].first, make_pair(1ll * con[X][i].second.first * inv % mod,
                                     inv *
                                         (con[X][i].second.second +
                                          c * con[X][i].second.first % mod) %
                                         mod)));
    }
  }
  con[X] = ncon;
  for (int i = 0; i < con[X].size(); i++) {
    int u = con[X][i].first;
    dpp[u] = (dpp[u] + 1ll * con[X][i].second.first * dpp[X]) % mod;
    dpl[u] = (dpl[u] + 1ll * con[X][i].second.first * dpl[X] +
              1ll * dpp[X] * con[X][i].second.second % mod) %
             mod;
  }
  dpp[X] = dpl[X] = 0;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < con[X].size(); i++) {
    if (!vis[con[X][i].first]) solve2(con[X][i].first, X);
  }
}
int main() {
  cin >> R >> a[0] >> a[1] >> a[2] >> a[3];
  int sum = a[0] + a[1] + a[2] + a[3];
  for (int i = 0; i < 4; i++) a[i] = 1ll * a[i] * qpow(sum, mod - 2) % mod;
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      if ((i - 50) * (i - 50) + (j - 50) * (j - 50) <= R * R) {
        id[i][j] = ++tot;
      } else
        continue;
    }
  }
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      if (!id[i][j]) continue;
      int cur = id[i][j];
      for (int t = 0; t < 4; t++) {
        int nx = i + dx[t], ny = j + dy[t];
        int nid = nx >= 0 && nx <= 100 && ny >= 0 && ny <= 100 ? id[nx][ny] : 0;
        adde(cur, nid, a[t], a[t]);
      }
    }
  }
  dpp[id[50][50]] = 1;
  dpl[id[50][50]] = 0;
  for (int si = 0; si <= 200; si++) {
    for (int j = 0; j <= 100; j++) {
      int i = si - j;
      if (i >= 0 && i <= 100 && id[i][j]) {
        solve(i, j);
      }
    }
  }
  cout << (dpl[0] % mod + mod) % mod << endl;
  return 0;
}