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 cnt, f[7846][7846], no[110][110], n, a, b, c, d, p1, p2, p3, p4;
long long qpow(long long a, long long i) {
  long long r = 1;
  for (; i; i >>= 1, a = a * a % 1000000007)
    if (i & 1) r = r * a % 1000000007;
  return r;
}
int main() {
  scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
  p1 = (long long)a * qpow(a + b + c + d, 1000000007 - 2) % 1000000007;
  p2 = (long long)b * qpow(a + b + c + d, 1000000007 - 2) % 1000000007;
  p3 = (long long)c * qpow(a + b + c + d, 1000000007 - 2) % 1000000007;
  p4 = (long long)d * qpow(a + b + c + d, 1000000007 - 2) % 1000000007;
  for (int i = n, x; i >= -n; i--) {
    x = floor(sqrt(n * n - i * i));
    for (int j = -x; j <= x; j++) no[i + n][j + n] = ++cnt;
  }
  for (int i = n, x; i >= -n; i--) {
    x = floor(sqrt(n * n - i * i));
    for (int j = -x; j <= x; j++) {
      int p, q;
      f[no[i + n][j + n]][no[i + n][j + n]] = 1000000007 - 1;
      f[no[i + n][j + n]][0] = 1000000007 - 1;
      p = i - 1;
      q = j;
      if (p * p + q * q <= n * n) f[no[i + n][j + n]][no[p + n][q + n]] = p1;
      p = i;
      q = j - 1;
      if (p * p + q * q <= n * n) f[no[i + n][j + n]][no[p + n][q + n]] = p2;
      p = i + 1;
      q = j;
      if (p * p + q * q <= n * n) f[no[i + n][j + n]][no[p + n][q + n]] = p3;
      p = i;
      q = j + 1;
      if (p * p + q * q <= n * n) f[no[i + n][j + n]][no[p + n][q + n]] = p4;
    }
  }
  for (int i = 1; i <= cnt; i++) {
    int ny = qpow(f[i][i], 1000000007 - 2);
    for (int l = i + 1; l <= i + n + n && l <= cnt; l++)
      if (f[l][i] > 0) {
        int v = (long long)f[l][i] * ny % 1000000007;
        f[l][0] = (f[l][0] - (long long)f[i][0] * v % 1000000007 + 1000000007) %
                  1000000007;
        for (int k = i + 1; k <= cnt && k <= i + n + n; k++)
          f[l][k] =
              (f[l][k] - (long long)f[i][k] * v % 1000000007 + 1000000007) %
              1000000007;
      }
  }
  for (int i = cnt; i; i--) {
    for (int l = i + 1; l <= i + n + n && l <= cnt; l++) {
      f[i][0] =
          (f[i][0] - (long long)f[i][l] * f[l][0] % 1000000007 + 1000000007) %
          1000000007;
    }
    f[i][0] = (long long)f[i][0] * qpow(f[i][i], 1000000007 - 2) % 1000000007;
  }
  printf("%d", f[no[n][n]][0]);
  return 0;
}
