Problem: Vasya plays the Power Defence. 

He must pass the last level of the game. In order to do this he must kill the Main Villain, who moves in a straight line at speed 1 meter per second from the point ( - ∞, 0) to the point ( + ∞, 0) of the game world. In the points (x, 1) and (x, - 1), where x is an integer number, Vasya can build towers of three types: fire-tower, electric-tower or freezing-tower. However, it is not allowed to build two towers at the same point. Towers of each type have a certain action radius and the value of damage per second (except freezing-tower). If at some point the Main Villain is in the range of action of k freezing towers then his speed is decreased by k + 1 times.

The allowed number of towers of each type is known. It is necessary to determine the maximum possible damage we can inflict on the Main Villain.

All distances in the problem are given in meters. The size of the Main Villain and the towers are so small, that they can be considered as points on the plane. The Main Villain is in the action radius of a tower if the distance between him and tower is less than or equal to the action radius of the tower.

Input

The first line contains three integer numbers nf, ne and ns — the maximum number of fire-towers, electric-towers and freezing-towers that can be built (0 ≤ nf, ne, ns ≤ 20, 1 ≤ nf + ne + ns ≤ 20). The numbers are separated with single spaces.

The second line contains three integer numbers rf, re and rs (1 ≤ rf, re, rs ≤ 1000) — the action radii of fire-towers, electric-towers and freezing-towers. The numbers are separated with single spaces.

The third line contains two integer numbers df and de (1 ≤ df, de ≤ 1000) — the damage a fire-tower and an electronic-tower can inflict on the Main Villain per second (in the case when the Main Villain is in the action radius of the tower). The numbers are separated with single space.

Output

Print the only real number — the maximum possible damage to the Main Villain with absolute or relative error not more than 10 - 6.

Examples

Input

1 0 0
10 10 10
100 100


Output

1989.97487421

Input

1 0 1
10 10 10
100 100


Output

3979.94974843

Note

In the first sample we've got one fire-tower that always inflicts the same damage, independently of its position. 

In the second sample we've got another freezing-tower of the same action radius. If we build the two towers opposite each other, then the Main Villain's speed will be two times lower, whenever he enters the fire-tower's action radius. That means that the enemy will be inflicted with twice more damage.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
clock_t __stt;
inline void TStart() { __stt = clock(); }
inline void TReport() {
  printf("\nTaken Time : %.3lf sec\n",
         (double)(clock() - __stt) / CLOCKS_PER_SEC);
}
template <typename T>
T MIN(T a, T b) {
  return a < b ? a : b;
}
template <typename T>
T MAX(T a, T b) {
  return a > b ? a : b;
}
template <typename T>
T ABS(T a) {
  return a > 0 ? a : (-a);
}
template <typename T>
void UMIN(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
void UMAX(T &a, T b) {
  if (b > a) a = b;
}
int n[3], r[3], a[2], s;
double R[3];
namespace flows {
const int N = 25;
struct edge {
  int v, f, r;
  double c;
  void set(int V, int F, double C, int R) {
    v = V;
    f = F;
    c = C;
    r = R;
  }
} T;
vector<edge> adj[N];
int prevv[N], preve[N];
double dis[N];
bool inq[N];
queue<int> Q;
void addedge(int u, int v, int f, double c) {
  T.set(v, f, c, (int)adj[v].size());
  adj[u].push_back(T);
  T.set(u, 0, -c, (int)adj[u].size() - 1);
  adj[v].push_back(T);
}
void spfa() {
  while (!Q.empty()) Q.pop();
  Q.push(0);
  fill(dis, dis + N, 1e10);
  memset(inq, 0, sizeof(inq));
  dis[0] = 0;
  inq[0] = 1;
  while (!Q.empty()) {
    int c = Q.front(), i;
    Q.pop();
    inq[c] = 0;
    for (i = 0; i < (int)adj[c].size(); ++i) {
      edge &E = adj[c][i];
      if (E.f > 0 && dis[c] + E.c + 1e-8 < dis[E.v]) {
        dis[E.v] = dis[c] + E.c;
        prevv[E.v] = c;
        preve[E.v] = i;
        if (!inq[E.v]) Q.push(E.v);
        inq[E.v] = 1;
      }
    }
  }
}
double mincostflow() {
  double ret = 0;
  int i;
  while (1) {
    spfa();
    if (dis[1] >= 1e9) {
      for (i = 0; i < N; ++i) adj[i].clear();
      return ret;
    }
    double sumc = 0;
    int minf = 2000000000;
    for (i = 1; i; i = prevv[i]) {
      UMIN(minf, adj[prevv[i]][preve[i]].f);
      sumc += adj[prevv[i]][preve[i]].c;
    }
    ret += sumc * (double)minf;
    for (i = 1; i; i = prevv[i]) {
      edge &E = adj[prevv[i]][preve[i]];
      E.f -= minf;
      adj[E.v][E.r].f += minf;
    }
  }
}
};  // namespace flows
int fc[20];
double res;
void dfs(int pos, int fct, int ect) {
  if (ect > n[0] + n[1] + 1 || fct > n[2]) return;
  if (fct == n[2]) {
    int i, j, k;
    for (i = 0; i < pos; ++i) {
      double cst[2];
      cst[0] = 2.0 * R[0];
      cst[1] = 2.0 * R[1];
      for (j = 0; j < pos; ++j) {
        cst[0] += fc[j] * MAX(0.0, MIN((double)i + R[0], (double)j + R[2]) -
                                       MAX((double)i - R[0], (double)j - R[2]));
        cst[1] += fc[j] * MAX(0.0, MIN((double)i + R[1], (double)j + R[2]) -
                                       MAX((double)i - R[1], (double)j - R[2]));
      }
      cst[0] *= (double)a[0];
      cst[1] *= (double)a[1];
      flows::addedge(2, i + 4, 2, -cst[0]);
      flows::addedge(3, i + 4, 2, -cst[1]);
      flows::addedge(i + 4, 1, 2 - fc[i], 0);
    }
    flows::addedge(0, 2, n[0], 0);
    flows::addedge(0, 3, n[1], 0);
    UMAX(res, -flows::mincostflow());
  }
  fc[pos] = 0;
  dfs(pos + 1, fct, ect + 2);
  fc[pos] = 1;
  dfs(pos + 1, fct + 1, ect + 1);
  fc[pos] = 2;
  dfs(pos + 1, fct + 2, ect);
}
int main() {
  int i, j, k;
  for (i = 0; i < 3; ++i) {
    scanf("%d", n + i);
    s += n[i];
  }
  for (i = 0; i < 3; ++i) {
    scanf("%d", r + i);
    R[i] = sqrt((double)(r[i] * r[i]) - 1.0);
  }
  for (i = 0; i < 2; ++i) scanf("%d", a + i);
  res = 0;
  dfs(0, 0, 0);
  printf("%.7lf\n", res);
  return 0;
}