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>.
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int power(int x, int t) {
  int ret = 1;
  while (t > 0) {
    if (t & 1) ret = 1LL * ret * x % MOD;
    x = 1LL * x * x % MOD;
    t >>= 1;
  }
  return ret;
}
int r, a1, a2, a3, a4;
int deg;
struct poly {
  int tot[205];
  poly() { memset(tot, 0, sizeof(tot)); }
  poly(const poly& oth) {
    for (int i = 0; i < (int)(deg + 1); i++) tot[i] = oth.tot[i];
  }
  poly(int x) {
    memset(tot, 0, sizeof(tot));
    tot[0] = x;
  }
};
poly operator+(const poly& a, const poly& b) {
  poly ret;
  for (int i = 0; i < (int)(deg + 1); i++)
    ret.tot[i] = (a.tot[i] + b.tot[i]) % MOD;
  return ret;
}
poly operator-(const poly& a, const poly& b) {
  poly ret;
  for (int i = 0; i < (int)(deg + 1); i++)
    ret.tot[i] = (a.tot[i] - b.tot[i] + MOD) % MOD;
  return ret;
}
poly operator*(const poly& a, int b) {
  poly ret;
  for (int i = 0; i < (int)(deg + 1); i++)
    ret.tot[i] = 1LL * a.tot[i] * b % MOD;
  return ret;
}
poly pol[105][105];
const int SX = 50, SY = 50;
int cnt;
poly equ[505];
int g_elim() {
  for (int i = 0; i < (int)(cnt); i++) {
    if (equ[i].tot[i + 1] == 0)
      for (int j = i + 1; j < cnt; j++)
        if (equ[j].tot[i + 1] != 0) {
          swap(equ[i], equ[j]);
          break;
        }
    equ[i] = equ[i] * power(equ[i].tot[i + 1], MOD - 2);
    for (int j = i + 1; j < cnt; j++)
      equ[j] = equ[j] - equ[i] * equ[j].tot[i + 1];
  }
  return (MOD - equ[deg - 1].tot[0]) % MOD;
}
int main() {
  cin >> r >> a1 >> a2 >> a3 >> a4;
  if (r == 0) {
    printf("%d\n", 1);
    return 0;
  }
  int p1, p2, p3, p4;
  p1 = p2 = p3 = p4 = power(a1 + a2 + a3 + a4, MOD - 2);
  p1 = 1LL * p1 * a1 % MOD;
  p2 = 1LL * p2 * a2 % MOD;
  p3 = 1LL * p3 * a3 % MOD;
  p4 = 1LL * p4 * a4 % MOD;
  for (int i = -r; i <= r; i++)
    if (i != 0) pol[SX][SY + i].tot[++deg] = 1;
  for (int i = -r + 1; i <= r - 1; i++) pol[SX + 1][SY + i].tot[++deg] = 1;
  pol[SX][SY].tot[++deg] = 1;
  for (int i = 2; i <= r; i++)
    for (int j = -r; j <= r; j++)
      if (i * i + j * j <= r * r) {
        pol[SX + i][SY + j] =
            (pol[SX + i - 1][SY + j] - pol[SX + i - 2][SY + j] * p3 -
             pol[SX + i - 1][SY + j - 1] * p2 -
             pol[SX + i - 1][SY + j + 1] * p4 - poly(1)) *
            power(p1, MOD - 2);
      }
  for (int i = -1; i >= -r; i--)
    for (int j = -r; j <= r; j++)
      if (i * i + j * j <= r * r) {
        pol[SX + i][SY + j] =
            (pol[SX + i + 1][SY + j] - pol[SX + i + 2][SY + j] * p1 -
             pol[SX + i + 1][SY + j - 1] * p2 -
             pol[SX + i + 1][SY + j + 1] * p4 - poly(1)) *
            power(p3, MOD - 2);
      }
  cnt = 0;
  for (int i = -r; i <= r; i++)
    for (int j = -r; j <= r; j++)
      if (i * i + j * j <= r * r) {
        equ[cnt] = pol[SX + i][SY + j] - poly(1) -
                   pol[SX + i + 1][SY + j] * p1 - pol[SX + i - 1][SY + j] * p3 -
                   pol[SX + i][SY + j - 1] * p2 - pol[SX + i][SY + j + 1] * p4;
        for (int i = 0; i <= deg; i++)
          if (equ[cnt].tot[i] != 0) {
            cnt++;
            break;
          }
      }
  printf("%d\n", g_elim());
  return 0;
}
