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;
long long idx, n = 102, R, p[4], id[111][111];
int g[8001][8001];
long long read() {
  long long 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;
}
const long long dx[4] = {-1, 0, 1, 0};
const long long dy[4] = {0, -1, 0, 1};
long long sqr(long long x) { return x * x; }
long long getinv(long long x) {
  if (x == 1) return 1;
  return (1000000007 - 1000000007 / x) * getinv(1000000007 % x) % 1000000007;
}
void GaussSolve(long long n, long long m) {
  long long u = 1;
  for (long long c = 1; c <= m; ++c) {
    long long s = u;
    while (s <= n && !g[s][c]) s++;
    if (s > n) {
      u--;
      continue;
    }
    if (s ^ u) {
      for (long long i = c; i <= m + 1; ++i) {
        swap(g[u][i], g[s][i]);
      }
    }
    long long inv = getinv(g[u][c]);
    for (long long i = c; i <= min(m, c + 104); ++i) {
      g[u][i] = (long long)g[u][i] * inv % 1000000007;
    }
    g[u][m + 1] = (long long)g[u][m + 1] * inv % 1000000007;
    for (long long v = u + 1; v <= min(n, u + 104); ++v) {
      if (u ^ v) {
        long long val = g[v][c];
        for (long long i = c; i <= min(m, c + 104); ++i) {
          g[v][i] = ((long long)g[v][i] -
                     (long long)g[u][i] * val % 1000000007 + 1000000007) %
                    1000000007;
        }
        g[v][m + 1] = ((long long)g[v][m + 1] -
                       (long long)g[u][m + 1] * val % 1000000007 + 1000000007) %
                      1000000007;
      }
    }
    u++;
  }
  for (long long i = n; i >= 1; --i) {
    for (long long j = i + 1; j <= n; ++j) {
      g[i][m + 1] = ((long long)g[i][m + 1] -
                     (long long)g[i][j] * (long long)g[j][m + 1] % 1000000007 +
                     1000000007) %
                    1000000007;
    }
  }
}
signed main() {
  R = read();
  p[0] = read(), p[1] = read(), p[2] = read(), p[3] = read();
  long long inv = getinv(p[0] + p[1] + p[2] + p[3]);
  for (long long i = 0; i <= 3; ++i) p[i] = p[i] * inv % 1000000007;
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= n; ++j) {
      if (sqr(51 - i) + sqr(51 - j) <= sqr(R)) {
        id[i][j] = ++idx;
      }
    }
  }
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= n; ++j) {
      if (sqr(51 - i) + sqr(51 - j) <= sqr(R)) {
        long long t = id[i][j];
        for (long long d = 0; d < 4; ++d) {
          long long xx = i + dx[d];
          long long yy = j + dy[d];
          if (sqr(51 - xx) + sqr(51 - yy) <= sqr(R)) {
            g[t][id[xx][yy]] = 1000000007 - p[d];
          }
        }
        g[t][idx + 1] = 1;
        g[t][t] = 1;
      }
    }
  }
  GaussSolve(idx, idx);
  cout << g[id[51][51]][idx + 1] << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
