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;
int sqr(int x) { return x * x; }
vector<pair<int, int> > v;
map<pair<int, int>, int> id;
int m[8000][8000], X[8000];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int cnt;
long long qpow(long long a, long long b) {
  long long ret = 1LL;
  while (b) {
    if (b & 1) ret = ret * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ret;
}
long long inv(long long x) { return qpow(x, mod - 2); }
void CAL() {
  for (int i = 0; i < cnt; ++i) {
    long long x = inv(m[i][i]);
    for (int j = i; j < min(cnt, i + 111); ++j) m[i][j] = m[i][j] * x % mod;
    X[i] = X[i] * x % mod;
    vector<int> O;
    vector<long long> T;
    for (int j = i + 1; j < min(i + 111, cnt); ++j) {
      if (j == i) continue;
      if (!m[j][i]) continue;
      O.push_back(j), T.push_back(m[j][i]);
      X[j] = (X[j] - (long long)X[i] * m[j][i] % mod + mod) % mod;
    }
    for (int j = i; j < min(cnt, i + 111); ++j) {
      if (!m[i][j]) continue;
      for (int k = 0; k < O.size(); ++k)
        m[O[k]][j] = (m[O[k]][j] - T[k] * m[i][j] % mod + mod) % mod;
    }
  }
  for (int i = cnt - 1; i >= 0; --i) {
    for (int j = i - 1; j >= max(0, i - 111); --j) {
      if (m[j][i] == 0) continue;
      X[j] = (X[j] - (long long)X[i] * m[j][i] % mod + mod) % mod;
    }
  }
}
int main() {
  int R, a[4];
  scanf("%d", &R);
  for (int i = 0; i < 4; ++i) scanf("%d", a + i);
  for (int i = 0; i <= 200; ++i) {
    for (int j = 0; j <= 200; ++j) {
      if (sqr(100 - i) + sqr(100 - j) <= sqr(R))
        v.push_back(pair<int, int>(i, j)), id[pair<int, int>(i, j)] = cnt++;
    }
  }
  for (int i = 0; i < cnt; ++i) {
    m[i][i] = 1;
    for (int k = 0; k < 4; ++k) {
      int xx = v[i].first + dx[k];
      int yy = v[i].second + dy[k];
      if (id.find(pair<int, int>(xx, yy)) == id.end()) continue;
      m[i][id[pair<int, int>(xx, yy)]] =
          (mod - a[k] * inv(a[0] + a[1] + a[2] + a[3]) % mod + mod) % mod;
    }
  }
  X[id[pair<int, int>(100, 100)]] = 1;
  CAL();
  long long ans = 0;
  for (int i = 0; i < cnt; ++i) ans = (ans + X[i]) % mod;
  cout << ans << endl;
  return 0;
}