#include <bits/stdc++.h>
using namespace std;
struct E {
  int n;
  long long t, b;
  E(int nn, long long tt, long long bb) {
    n = nn;
    t = tt;
    b = bb;
  }
};
bool operator<(const E &e1, const E &e2) {
  if (e1.t != e2.t) return e1.t >= e2.t;
  return e1.n < e2.n;
}
int n;
long long t[3], q[3];
priority_queue<E> qu;
vector<queue<pair<long long, long long> > > w;
int main() {
  w.resize(3);
  for (int i = 0; i < 3; i++) cin >> q[i];
  for (int i = 0; i < 3; i++) cin >> t[i];
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    qu.push(E(4, x, x));
  }
  long long ans = 0;
  while (!qu.empty()) {
    E e = qu.top();
    qu.pop();
    if (e.n == 4)
      w[0].push(make_pair(e.t, e.t));
    else if (e.n != 2) {
      q[e.n]++;
      w[e.n + 1].push(make_pair(e.t, e.b));
    }
    if (e.n == 2) q[2]++;
    for (int i = 2; i >= 0; i--)
      while (!w[i].empty() && q[i] > 0) {
        pair<long long, long long> now = w[i].front();
        w[i].pop();
        qu.push(E(i, e.t + t[i], now.second));
        q[i]--;
      }
    if (e.n == 2) ans = max(ans, e.t - e.b);
  }
  cout << ans << endl;
  return 0;
}
