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;
long long expo(long long a, long long b) {
  if (!b) return 1;
  a %= 1000000007;
  if (b & 1) return a * expo(a * a, b >> 1) % 1000000007;
  return expo(a * a, b >> 1);
}
long long inv_mod(long long x) { return expo(x, 1000000007 - 2); }
long long dist(long long x1, long long y1, long long x2, long long y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
int r, a[4], val[4], cont, id[103][103], mat[7850][7850], ans[7850];
pair<int, int> cell[7900];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
void gauss(int a[7850][7850], int n, int m, int *ans) {
  int margin = 0;
  for (int row = 0; row < n; row++) {
    int x = cell[row].first, y = cell[row].second;
    margin = max(margin, id[x + 1][y]);
    for (int i = row + 1; i <= margin; i++) {
      int coef = 1LL * a[i][row] * inv_mod(a[row][row]) % 1000000007;
      for (int j = row; coef && j <= margin; j++) {
        a[i][j] -= 1LL * a[row][j] * coef % 1000000007;
        if (a[i][j] < 0) a[i][j] += 1000000007;
      }
      a[i][m] -= 1LL * a[row][m] * coef % 1000000007;
      if (a[i][m] < 0) a[i][m] += 1000000007;
    }
  }
  for (int row = n - 1; ~row; row--) {
    for (int col = n - 1; col > row; col--) {
      a[row][m] -= 1LL * a[row][col] * ans[col] % 1000000007;
      if (a[row][m] < 0) a[row][m] += 1000000007;
    }
    ans[row] = a[row][m] * inv_mod(a[row][row]) % 1000000007;
  }
}
int main() {
  scanf("%d %d %d %d %d", &r, &a[0], &a[1], &a[2], &a[3]);
  r *= r;
  for (int d = 0; d < 4; d++) {
    val[d] = 1LL * a[d] * inv_mod(a[0] + a[1] + a[2] + a[3]) % 1000000007;
  }
  memset(id, -1, sizeof id);
  for (int i = 0; i <= 102; i++) {
    for (int j = 0; j <= 102; j++) {
      if (dist(51, 51, i, j) <= r) {
        id[i][j] = cont;
        cell[cont++] = {i, j};
      }
    }
  }
  for (int i = 0; i < cont; i++) {
    mat[i][i] = 1;
    mat[i][cont] = 1;
    for (int d = 0; d < 4; d++) {
      int nx = cell[i].first + dx[d], ny = cell[i].second + dy[d];
      if (id[nx][ny] == -1) continue;
      mat[i][id[nx][ny]] -= val[d];
      if (mat[i][id[nx][ny]] < 0) mat[i][id[nx][ny]] += 1000000007;
    }
  }
  gauss(mat, cont, cont, ans);
  printf("%d\n", ans[id[51][51]]);
  return 0;
}