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;
int n, m, cnt, ans, mo = 1e9 + 7, sd = 60;
int id[120][120], x[8000][8000], tot, p1, p2, p3, p4;
void add(int &a, int b) {
  a += b;
  if (a >= mo) a -= mo;
}
int pw(int i, int k) {
  int a = 1;
  while (k) {
    if (k & 1) a = (long long)a * i % mo;
    i = (long long)i * i % mo;
    k >>= 1;
  }
  return a;
}
void gauss() {
  int i, s, a, b, j, k;
  for (i = j = 1; i <= tot; i++) {
    for (s = j; s <= tot && s <= i + 2 * n; s++) {
      if (x[s][i]) {
        if (s != j) {
          for (k = i; k <= tot && k <= i + 2 * n; k++) swap(x[s][k], x[j][k]);
          swap(x[s][tot + 1], x[j][tot + 1]);
        }
        break;
      }
    }
    if (!x[j][i]) continue;
    a = pw(x[j][i], mo - 2);
    for (s = i; s <= i + 2 * n && s <= tot; s++)
      x[j][s] = (long long)x[j][s] * a % mo;
    x[j][tot + 1] = (long long)x[j][tot + 1] * a % mo;
    for (k = j + 1; k <= tot && k <= i + 2 * n; k++) {
      a = x[k][i];
      if (!a) continue;
      for (s = i; s <= tot && s <= i + 2 * n; s++) {
        add(x[k][s], mo - (long long)a * x[j][s] % mo);
      }
      add(x[k][tot + 1], mo - (long long)a * x[j][tot + 1] % mo);
    }
    j++;
  }
  for (i = tot; i; i--) {
    for (s = i + 1; s <= tot && s <= i + 2 * n; s++)
      add(x[i][tot + 1], mo - (long long)x[s][tot + 1] * x[i][s] % mo);
    x[i][tot + 1] = (long long)x[i][tot + 1] * pw(x[i][i], mo - 2) % mo;
  }
}
int main() {
  int i, s, a, b, j, k;
  scanf("%d%d%d%d%d", &n, &p1, &p2, &p3, &p4);
  k = pw(((long long)p1 + p2 + p3 + p4) % mo, mo - 2);
  p1 = (long long)p1 * k % mo;
  p2 = (long long)p2 * k % mo;
  p3 = (long long)p3 * k % mo;
  p4 = (long long)p4 * k % mo;
  for (i = -n; i <= n; i++)
    for (s = -n; s <= n; s++)
      if (i * i + s * s <= n * n) {
        id[i + sd][s + sd] = ++tot;
      }
  x[id[sd][sd]][tot + 1] = 1;
  for (i = -n; i <= n; i++)
    for (s = -n; s <= n; s++)
      if (i * i + s * s <= n * n) {
        x[id[i + sd][s + sd]][tot + 1] =
            x[id[i + sd][s + sd]][id[i + sd][s + sd]] = 1;
        if (id[i + sd - 1][s + sd])
          x[id[i + sd][s + sd]][id[i + sd - 1][s + sd]] = mo - p1;
        if (id[i + sd][s + sd - 1])
          x[id[i + sd][s + sd]][id[i + sd][s + sd - 1]] = mo - p2;
        if (id[i + sd + 1][s + sd])
          x[id[i + sd][s + sd]][id[i + sd + 1][s + sd]] = mo - p3;
        if (id[i + sd][s + sd + 1])
          x[id[i + sd][s + sd]][id[i + sd][s + sd + 1]] = mo - p4;
      }
  gauss();
  printf("%d", x[id[sd][sd]][tot + 1]);
  return 0;
}
