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;
const int R = 52;
int r, a1, a2, a3, a4;
int id[R * 2][R * 2], idcnt;
long long p1, p2, p3, p4;
long long Pow(long long x, int p) {
  if (p == 0) return 1;
  if (p & 1) return x * Pow(x * x % MOD, p >> 1) % MOD;
  return Pow(x * x % MOD, p >> 1);
}
int fc[8000][8000];
struct GAUSS {
  int n;
  int *a[8000];
  void Init(int _n, int *x) {
    n = _n;
    for (int i = 0; i <= n; i++) {
      a[i] = x;
      x += 8000;
    }
  }
  inline double Abs(double x) { return x > 0 ? x : -x; }
  long long Guass() {
    long long tmp;
    int d = 2 * r;
    for (int i = 1; i <= n; i++) {
      long long inv = Pow(a[i][i], MOD - 2);
      for (int j = i + 1; j <= i + d && j <= n; j++)
        if (j != i && a[j][i]) {
          tmp = a[j][i] * inv % MOD;
          a[j][i] = 0;
          for (int k = i + 1; k <= i + d && k <= n; k++)
            a[j][k] = (a[j][k] - tmp * a[i][k]) % MOD;
          a[j][n + 1] = (a[j][n + 1] - tmp * a[i][n + 1]) % MOD;
        }
    }
    int goal = id[0 + R][0 + R];
    for (int i = n; i >= goal; i--) {
      long long inv = Pow(a[i][i], MOD - 2);
      int &t = a[i][n + 1];
      t = inv * t % MOD;
      for (int j = i - 1; j >= goal; j--)
        a[j][n + 1] = (a[j][n + 1] - (long long)a[j][i] * t) % MOD;
    }
    return a[goal][n + 1];
  }
} GE;
int main() {
  scanf("%d %d %d %d %d", &r, &a1, &a2, &a3, &a4);
  long long inv = Pow(((long long)a1 + a2 + a3 + a4) % MOD, MOD - 2);
  p1 = a1 * inv % MOD;
  p2 = a2 * inv % MOD;
  p3 = a3 * inv % MOD;
  p4 = a4 * inv % MOD;
  for (int x = -r; x <= r; x++)
    for (int y = -r; y <= r; y++)
      if (x * x + y * y <= r * r) id[x + R][y + R] = ++idcnt;
  for (int x = -r; x <= r; x++)
    for (int y = -r; y <= r; y++)
      if (int f = id[x + R][y + R]) {
        fc[f][f] = -1;
        if (int t = id[x - 1 + R][y + R]) fc[f][t] = p1;
        if (int t = id[x + R][y - 1 + R]) fc[f][t] = p2;
        if (int t = id[x + 1 + R][y + R]) fc[f][t] = p3;
        if (int t = id[x + R][y + 1 + R]) fc[f][t] = p4;
        fc[f][idcnt + 1] = -1;
      }
  GE.Init(idcnt, &fc[0][0]);
  printf("%d\n", (GE.Guass() + MOD) % MOD);
  return 0;
}
