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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline int pow(int x, int k) {
  int sum = 1;
  for (; k; k >>= 1, x = 1LL * x * x % 1000000007)
    if (k & 1) sum = 1LL * sum * x % 1000000007;
  return sum;
}
int a[7900 + 5][7900 + 5], res[7900 + 5];
int R, a1, a2, a3, a4, cnt, id[105][105], ans;
inline int& ID(int x, int y) { return id[x + R + 1][y + R + 1]; }
void Gauss() {
  for (int i = 1; i <= cnt; ++i) {
    for (int j = i; j <= cnt && j <= i + 100; ++j)
      if (a[j][i]) {
        if (j != i) {
          for (int k = i; k <= cnt && k <= i + 100; ++k) swap(a[i][k], a[j][k]);
          swap(a[i][cnt + 1], a[j][cnt + 1]);
        }
        break;
      }
    if (!a[i][i]) continue;
    int Inv = pow(a[i][i], 1000000007 - 2);
    for (int j = i + 1; j <= cnt && j <= i + 100; ++j)
      if (a[j][i]) {
        int t = 1LL * Inv * a[j][i] % 1000000007;
        for (int k = i; k <= cnt && k <= i + 100; ++k)
          a[j][k] = (a[j][k] - 1LL * a[i][k] * t % 1000000007 + 1000000007) %
                    1000000007;
        a[j][cnt + 1] = (a[j][cnt + 1] - 1LL * a[i][cnt + 1] * t % 1000000007 +
                         1000000007) %
                        1000000007;
      }
  }
  for (int i = cnt; i; --i) {
    int t = a[i][cnt + 1];
    for (int j = i + 1; j <= cnt && j <= i + 100; ++j)
      t = (t - 1LL * a[i][j] * res[j] % 1000000007 + 1000000007) % 1000000007;
    res[i] = 1LL * t * pow(a[i][i], 1000000007 - 2) % 1000000007;
  }
  ans = res[ID(0, 0)];
}
int main() {
  R = read();
  a1 = read();
  a2 = read();
  a3 = read();
  a4 = read();
  int inv = pow(a1 + a2 + a3 + a4, 1000000007 - 2);
  for (int i = -R; i <= R; ++i)
    for (int j = -R; j <= R; ++j)
      if (i * i + j * j <= R * R) ID(i, j) = ++cnt, a[cnt][cnt] = 1;
  a[ID(0, 0)][cnt + 1] = 1;
  for (int i = -R; i <= R; ++i)
    for (int j = -R; j <= R; ++j)
      if (i * i + j * j <= R * R) {
        if (ID(i - 1, j))
          a[ID(i - 1, j)][ID(i, j)] = 1000000007 - 1LL * a1 * inv % 1000000007;
        if (ID(i, j - 1))
          a[ID(i, j - 1)][ID(i, j)] = 1000000007 - 1LL * a2 * inv % 1000000007;
        if (ID(i + 1, j))
          a[ID(i + 1, j)][ID(i, j)] = 1000000007 - 1LL * a3 * inv % 1000000007;
        if (ID(i, j + 1))
          a[ID(i, j + 1)][ID(i, j)] = 1000000007 - 1LL * a4 * inv % 1000000007;
        a[ID(i, j)][cnt + 1] = 1;
      }
  Gauss();
  cout << ans;
  return 0;
}