#include <bits/stdc++.h>
using namespace std;
ifstream in("dfs.in");
ofstream out("dfs.out");
int main() {
  long long Free[3], k[3], t[3], n, ans = 0;
  Free[0] = Free[1] = Free[2] = 0;
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      Que[3][2];
  cin >> k[0] >> k[1] >> k[2];
  cin >> t[0] >> t[1] >> t[2];
  cin >> n;
  vector<long long> A(n);
  int finished = 0;
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
    Que[0][0].push(pair<long long, long long>(A[i], i));
  }
  while (finished < n) {
    long long ci, cj, tt = 2e16;
    for (int i = 2; i >= 0; i--) {
      for (int j = 1; j >= 0; j--) {
        if (j == 0) {
          if (Que[i][1].size() < k[i])
            if (Que[i][j].size() > 0 && Que[i][j].top().first < tt) {
              tt = Que[i][j].top().first;
              ci = i;
              cj = j;
            }
        } else {
          if (Que[i][j].size() > 0 && Que[i][j].top().first < tt) {
            tt = Que[i][j].top().first;
            ci = i;
            cj = j;
          }
        }
      }
    }
    pair<long long, long long> tempo = Que[ci][cj].top();
    Que[ci][cj].pop();
    if (cj == 1) {
      if (ci == 2) {
        ans = max(ans, tempo.first - A[tempo.second]);
        finished++;
      } else {
        Que[ci + 1][0].push(tempo);
      }
    } else {
      tempo.first = max(tempo.first, Free[ci]) + t[ci];
      Que[ci][1].push(tempo);
      if (Que[ci][1].size() == k[ci]) {
        Free[ci] = Que[ci][1].top().first;
      }
    }
  }
  cout << ans;
  return 0;
}
