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, c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f == 1 ? x : -x;
}
const int mod = 1e9 + 7;
inline int fix(int x) { return x + ((x >> 31) & mod); }
inline int add(int x, int y) { return fix(x + y - mod); }
inline int dec(int x, int y) { return fix(x - y); }
inline int mul(int x, int y) { return int((long long)x * y % mod); }
inline void ADD(int &x, int y) { x = fix(x + y - mod); }
inline void DEC(int &x, int y) { x = fix(x - y); }
inline void MUL(int &x, int y) { x = int((long long)x * y % mod); }
inline int ksm(int x, int r) {
  int ret = 1;
  for (int i = 0; (1ll << i) <= r; i++) {
    if ((r >> i) & 1) MUL(ret, x);
    MUL(x, x);
  }
  return ret;
}
inline int inv(int x) { return ksm(x, mod - 2); }
const int N = 104, M = 7850;
int tot, R, iv, p[4], a[M][M], id[N][N];
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
inline void gauss() {
  for (int i = 1, tmp; i <= tot; i++) {
    for (int j = i + 1, jj = 1; j <= tot && jj <= R; j++, jj++) {
      tmp = mul(a[j][i], inv(a[i][i]));
      for (int k = i, kk = 0; k <= tot && kk <= R; k++, kk++) {
        DEC(a[j][k], mul(tmp, a[i][k]));
      }
      DEC(a[j][tot + 1], mul(tmp, a[i][tot + 1]));
    }
  }
  for (int i = tot; i; i--) {
    MUL(a[i][tot + 1], inv(a[i][i]));
    for (int j = i - 1, jj = 1; j && jj <= R; j--, jj++)
      DEC(a[j][tot + 1], mul(a[i][tot + 1], a[j][i]));
  }
}
int main() {
  R = read();
  for (int i = 0; i ^ 4; i++) {
    p[i] = read();
    ADD(iv, p[i]);
  }
  iv = inv(iv);
  for (int i = 0; i ^ 4; i++) MUL(p[i], iv);
  for (int i = -R; i <= R; i++) {
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) {
        id[i + R][j + R] = ++tot;
      }
  }
  for (int i = 1; i <= tot; i++) a[i][i] = a[i][tot + 1] = 1;
  for (int i = -R, ni, nj, x; i <= R; i++) {
    for (int j = -R; j <= R; j++)
      if (i * i + j * j <= R * R) {
        x = id[i + R][j + R];
        for (int u = 0; u ^ 4; u++) {
          ni = i + dx[u];
          nj = j + dy[u];
          if (ni * ni + nj * nj <= R * R) {
            DEC(a[x][id[ni + R][nj + R]], p[u]);
          }
        }
      }
  }
  R = (R << 1) + 1;
  gauss();
  R >>= 1;
  cout << a[id[R][R]][tot + 1] << "\n";
  return (0 - 0);
}