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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int md = (int)1e9 + 7;
inline void add(int &a, int b) {
  a += b;
  if (a >= md) a -= md;
}
inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) a += md;
}
inline int mul(int a, int b) { return (int)((long long)a * b % md); }
inline int power(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
inline int inv(int a) {
  a %= md;
  if (a < 0) a += md;
  int b = md, u = 0, v = 1;
  while (a) {
    int t = b / a;
    b -= t * a;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}
int a[7900 + 5][7900 + 5], x[7900 + 5];
int R, a1, a2, a3, a4, cnt, id[105][105], ans;
inline int &ID(int x, int y) { return id[x + R + 1][y + R + 1]; }
void Gauss() {
  for (int i = 1; i <= cnt; ++i) {
    for (int j = i; j <= cnt && j <= i + 100; ++j)
      if (a[j][i]) {
        if (j != i) {
          for (int k = i; k <= cnt && k <= i + 100; ++k) swap(a[i][k], a[j][k]);
          swap(a[i][cnt + 1], a[j][cnt + 1]);
        }
        break;
      }
    if (!a[i][i]) continue;
    int Inv = inv(a[i][i]);
    for (int j = i + 1; j <= cnt && j <= i + 100; ++j)
      if (a[j][i]) {
        int t = mul(a[j][i], Inv);
        for (int k = i; k <= cnt && k <= i + 100; ++k)
          sub(a[j][k], mul(a[i][k], t));
        sub(a[j][cnt + 1], mul(a[i][cnt + 1], t));
      }
  }
  for (int i = cnt; i; --i) {
    int t = a[i][cnt + 1];
    for (int j = i + 1; j <= cnt && j <= i + 100; ++j)
      sub(t, mul(a[i][j], x[j]));
    x[i] = mul(t, inv(a[i][i]));
  }
  ans = x[ID(0, 0)];
}
int main() {
  R = read();
  a1 = read();
  a2 = read();
  a3 = read();
  a4 = read();
  int Inv = inv(a1 + a2 + a3 + a4);
  for (int i = -R; i <= R; ++i)
    for (int j = -R; j <= R; ++j)
      if (i * i + j * j <= R * R) ID(i, j) = ++cnt, a[cnt][cnt] = 1;
  for (int i = -R; i <= R; ++i)
    for (int j = -R; j <= R; ++j)
      if (i * i + j * j <= R * R) {
        if (ID(i - 1, j)) a[ID(i - 1, j)][ID(i, j)] = mul(-a1, Inv);
        if (ID(i, j - 1)) a[ID(i, j - 1)][ID(i, j)] = mul(-a2, Inv);
        if (ID(i + 1, j)) a[ID(i + 1, j)][ID(i, j)] = mul(-a3, Inv);
        if (ID(i, j + 1)) a[ID(i, j + 1)][ID(i, j)] = mul(-a4, Inv);
        a[ID(i, j)][cnt + 1] = 1;
      }
  Gauss();
  cout << ans << endl;
  return 0;
}