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 std::cin;
using std::cout;
using std::endl;
int readIn() {
  int a = 0;
  bool positive = true;
  char ch = getchar();
  while (!(ch == '-' || std::isdigit(ch))) ch = getchar();
  if (ch == '-') {
    positive = false;
    ch = getchar();
  }
  while (std::isdigit(ch)) {
    a = a * 10 - (ch - '0');
    ch = getchar();
  }
  return positive ? -a : a;
}
void printOut(int x) {
  char buffer[20];
  int length = 0;
  if (x < 0)
    putchar('-');
  else
    x = -x;
  do buffer[length++] = -(x % 10) + '0';
  while (x /= 10);
  do putchar(buffer[--length]);
  while (length);
}
const int mod = int(1e9) + 7;
const int maxn = 55;
int r;
int p1, p2, p3, p4;
int sum;
inline int code(int x) { return x + 50; }
inline double dis(int x, int y) {
  return std::sqrt(std::pow(x, 2) + std::pow(y, 2));
}
std::vector<std::pair<int, int> > pt;
int idx[maxn * 2][maxn * 2];
long long power(long long x, int y) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ret;
}
int rect[8000][8000];
void debugPrint() {
  for (int i = 1; i <= pt.size(); i++) {
    for (int j = 0; j <= pt.size(); j++) {
      printOut(rect[i][j]);
      putchar(' ');
    }
    putchar('\n');
  }
  putchar('\n');
}
void Gauss() {
  int d = r * 2;
  for (int i = 1; i <= pt.size(); i++) {
    long long inv = power(rect[i][i], mod - 2);
    for (int j = i + 1, to1 = 0; j <= pt.size() && to1 <= d; j++, to1++) {
      long long ratio = inv * rect[j][i] % mod;
      if (ratio) {
        for (int k = i, to2 = 0; k <= pt.size() && to2 <= d; k++, to2++)
          rect[j][k] = ((long long)rect[j][k] - rect[i][k] * ratio) % mod;
        rect[j][0] = ((long long)rect[j][0] - rect[i][0] * ratio) % mod;
      }
    }
  }
  for (int i = pt.size(), to = idx[code(0)][code(0)]; i >= to; i--) {
    long long inv = power(rect[i][i], mod - 2);
    int& t = rect[i][0];
    t = inv * t % mod;
    for (int j = i - 1; j >= to; j--)
      rect[j][0] = (rect[j][0] - (long long)rect[j][i] * t) % mod;
  }
}
void solve() {
  for (int x = r; x >= -r; x--)
    for (int y = -r; y <= r; y++)
      if (dis(x, y) <= r) {
        pt.push_back(std::make_pair(x, y));
        idx[code(x)][code(y)] = pt.size();
      }
  for (int x = r; x >= -r; x--)
    for (int y = -r; y <= r; y++)
      if (int f = idx[code(x)][code(y)]) {
        rect[f][f] = -1;
        if (int t = idx[code(x - 1)][code(y)]) rect[f][t] = p1;
        if (int t = idx[code(x)][code(y - 1)]) rect[f][t] = p2;
        if (int t = idx[code(x + 1)][code(y)]) rect[f][t] = p3;
        if (int t = idx[code(x)][code(y + 1)]) rect[f][t] = p4;
        rect[f][0] = -1;
      }
  Gauss();
  printOut((rect[idx[code(0)][code(0)]][0] + mod) % mod);
}
void run() {
  r = readIn();
  p1 = readIn();
  p2 = readIn();
  p3 = readIn();
  p4 = readIn();
  sum = ((long long)p1 + p2 + p3 + p4) % mod;
  long long inv = power(sum, mod - 2);
  p1 = (long long)p1 * inv % mod;
  p2 = (long long)p2 * inv % mod;
  p3 = (long long)p3 * inv % mod;
  p4 = (long long)p4 * inv % mod;
  solve();
}
int main() {
  run();
  return 0;
}
