#include <bits/stdc++.h>
using namespace std;
struct sNode {
  long long t;
};
struct sPeople {
  int st;
  long long nt;
};
bool operator<(const sNode &a, const sNode &b) { return a.t > b.t; }
bool operator<(const sPeople &a, const sPeople &b) { return a.nt > b.nt; }
priority_queue<sNode> pc[3];
priority_queue<sPeople> qe[4];
int work() {
  long long ans = 0LL;
  int kk[3], tt[3], n;
  cin >> kk[0] >> kk[1] >> kk[2];
  cin >> tt[0] >> tt[1] >> tt[2];
  cin >> n;
  sNode zr;
  zr.t = 0LL;
  sPeople pp;
  for (int i = 0, x; i < n; i++) {
    cin >> x;
    pp.nt = x;
    pp.st = x;
    qe[0].push(pp);
  }
  sNode dt;
  sPeople np;
  for (int k = 0; k < 3; k++) {
    for (int i = 0; i < kk[k] && i < n; i++) pc[k].push(zr);
    while (!qe[k].empty()) {
      dt = pc[k].top();
      np = qe[k].top();
      pc[k].pop();
      qe[k].pop();
      np.nt = max(dt.t, np.nt) + tt[k];
      dt.t = np.nt;
      pc[k].push(dt);
      if (k == 2)
        ans = max(ans, np.nt - np.st);
      else
        qe[k + 1].push(np);
    }
  }
  cout << ans << endl;
  return 0;
}
int main() {
  work();
  return 0;
}
