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 = 1000000007;
const int N = 7850;
int i, j, k, n, m, x, y, t, a1, a2, a3, a4, num;
int a[N][N];
pair<int, int> p[N];
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    f = ch == '-' ? -f : f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
map<pair<int, int>, int> mark;
int mi(int x, int y) {
  if (y == 0) return 1;
  int t = mi(x, y >> 1);
  t = 1ll * t * t % mod;
  return y & 1 ? (1ll * x * t % mod) : t;
}
int main() {
  n = read();
  a1 = read();
  a2 = read();
  a3 = read();
  a4 = read();
  x = mi(a1 + a2 + a3 + a4, mod - 2);
  a1 = 1ll * a1 * x % mod;
  a2 = 1ll * a2 * x % mod;
  a3 = 1ll * a3 * x % mod;
  a4 = 1ll * a4 * x % mod;
  for (j = -n; j <= n; j++)
    for (i = -n; i <= n; i++)
      if (i * i + j * j <= n * n) {
        mark[make_pair(i, j)] = ++num;
        p[num] = make_pair(i, j);
      }
  for (i = -n; i <= n; i++)
    for (j = -n; j <= n; j++)
      if (i * i + j * j <= n * n) {
        a[mark[make_pair(i, j)]][mark[make_pair(i, j)]] = 1;
        a[mark[make_pair(i, j)]][num + 1] = 1;
        if (mark[make_pair(i - 1, j)]) {
          a[mark[make_pair(i - 1, j)]][mark[make_pair(i, j)]] = mod - a3;
        }
        if (mark[make_pair(i + 1, j)]) {
          a[mark[make_pair(i + 1, j)]][mark[make_pair(i, j)]] = mod - a1;
        }
        if (mark[make_pair(i, j - 1)]) {
          a[mark[make_pair(i, j - 1)]][mark[make_pair(i, j)]] = mod - a4;
        }
        if (mark[make_pair(i, j + 1)]) {
          a[mark[make_pair(i, j + 1)]][mark[make_pair(i, j)]] = mod - a2;
        }
      }
  int te = 0, ans = mark[make_pair(0, 0)];
  for (i = 1; i < num; i++) {
    t = 0;
    for (j = i + 1; j <= num; j++)
      if ((p[j].second == p[i].second) ||
          (p[j].second == p[i].second + 1 && p[j].first <= p[i].first)) {
        t = j;
      } else if (p[j].second > p[i].second + 1)
        break;
    te += t - i + 1;
    for (j = i + 1; j <= t; j++) {
      x = j;
      int incr = 1ll * a[x][i] * mi(a[i][i], mod - 2) % mod;
      for (k = i; k <= t; k++)
        a[x][k] = (a[x][k] - 1ll * a[i][k] * incr % mod + mod) % mod;
      a[x][num + 1] =
          (a[x][num + 1] - 1ll * a[i][num + 1] * incr % mod + mod) % mod;
      if (p[j].first == p[i].first) break;
    }
    mark[make_pair(p[i].first, p[i].second)] = -1;
  }
  for (i = num; i >= 1; i--) {
    a[i][num + 1] = 1ll * a[i][num + 1] * mi(a[i][i], mod - 2) % mod;
    a[i][i] = 1;
    for (j = i - 1; j >= 1; j--)
      a[j][num + 1] =
          (a[j][num + 1] - 1ll * a[j][i] * a[i][num + 1] % mod + mod) % mod;
  }
  printf("%d\n", a[ans][num + 1]);
  return 0;
}
