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 N = 11000, mo = 1e9 + 7, Z = 55;
int fx[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
long long R, a[4];
long long iv;
int in[120][120], no;
long long f[N][120], e[N][120], len[N];
int fr[120], ed[120];
long long ksm(long long x, long long y) {
  long long ret = 1;
  for (; y; y >>= 1) {
    if (y & 1) ret = ret * x % mo;
    x = x * x % mo;
  }
  return ret;
}
long long v[N];
long long sum[N];
long long ee[120];
void sim(int z, int y) {
  long long zs = 0;
  for (int i = 1; i <= len[z]; i++)
    if (e[z][i] == z) {
      zs = f[z][i];
      break;
    }
  long long ys = 0;
  for (int i = 1; i <= len[y]; i++)
    if (e[y][i] == z) {
      ys = f[y][i];
      break;
    }
  if (ys == 0) return;
  for (int i = 1; i <= len[z]; i++) {
    f[z][i] = f[z][i] * ys % mo;
    sum[e[z][i]] -= f[z][i];
  }
  for (int i = 1; i <= len[y]; i++) {
    f[y][i] = f[y][i] * zs % mo;
    sum[e[y][i]] += f[y][i];
  }
  ee[0] = 0;
  for (int i = 1; i <= len[z]; i++) {
    if (sum[e[z][i]] != 0 || e[z][i] == 1) {
      ee[++ee[0]] = e[z][i];
      f[y][ee[0]] = sum[e[z][i]];
      sum[e[z][i]] = 0;
    }
  }
  for (int i = 1; i <= len[y]; i++) {
    if (sum[e[y][i]] != 0) {
      ee[++ee[0]] = e[y][i];
      f[y][ee[0]] = sum[e[y][i]];
      sum[e[y][i]] = 0;
    }
  }
  memcpy(e[y], ee, (ee[0] + 1) * (sizeof ee[0]));
  len[y] = ee[0];
}
int main() {
  cin >> R >> a[0] >> a[1] >> a[2] >> a[3];
  iv = a[0] + a[1] + a[2] + a[3];
  iv = ksm(iv, mo - 2);
  for (int x = -R; x <= R; x++) {
    int zz = 0;
    for (int y = -R; y <= R; y++)
      if (x * x + y * y <= R * R) {
        if (!zz) fr[Z + x] = y, zz = 1;
        ed[Z + x] = y;
        in[Z + x][Z + y] = ++no;
      }
  }
  for (int x = -R; x <= R; x++)
    for (int y = fr[Z + x]; y <= ed[Z + x]; y++) {
      int z = in[Z + x][Z + y];
      f[z][++len[z]] = -1;
      f[z][++len[z]] = -1;
      e[z][len[z]] = z;
      for (int i = 0; i < 4; i++) {
        int xx = x + fx[i][0], yy = y + fx[i][1];
        if (in[Z + xx][Z + yy]) {
          f[z][++len[z]] = a[i] * iv % mo;
          e[z][len[z]] = in[Z + xx][Z + yy];
        }
      }
    }
  for (int x = -R; x <= R; x++)
    for (int y = fr[Z + x]; y <= ed[Z + x]; y++) {
      int z = in[Z + x][Z + y];
      for (int yy = y + 1; yy <= ed[Z + x]; yy++) sim(z, in[Z + x][Z + yy]);
      if (x != R)
        for (int yy = fr[Z + x + 1]; yy <= y && yy <= ed[Z + x + 1]; yy++)
          sim(z, in[Z + x + 1][Z + yy]);
    }
  int g = 0;
  for (int x = R; ~x; x--)
    for (int y = ed[Z + x]; y >= fr[Z + x]; y--) {
      g = in[Z + x][Z + y];
      long long xs = 0;
      for (int i = 1; i <= len[g]; i++)
        if (e[g][i] != g) {
          f[g][1] -= v[e[g][i]] * f[g][i] % mo;
          if (f[g][1] <= -mo || f[g][1] >= mo) f[g][1] %= mo;
        } else
          xs = f[g][i];
      v[g] = f[g][1] * ksm(xs, mo - 2) % mo;
    }
  cout << (v[in[Z][Z]] % mo + mo) % mo << endl;
}