#include <bits/stdc++.h>
using namespace std;
priority_queue<long long> Q[3];
int K[4], T[5];
int n;
void gao() {
  int i, j;
  for (i = 0; i < 3; ++i) {
    for (j = 0; j < K[i]; ++j) Q[i].push(-1);
  }
  long long ans = 0;
  while (n--) {
    int ti;
    scanf("%d", &ti);
    long long now_min = Q[0].top();
    now_min = min(now_min, -ti + 0LL);
    Q[0].pop();
    now_min -= T[0];
    Q[0].push(now_min);
    long long tmp = Q[1].top();
    Q[1].pop();
    now_min = min(now_min, tmp);
    now_min -= T[1];
    Q[1].push(now_min);
    tmp = Q[2].top();
    Q[2].pop();
    now_min = min(now_min, tmp);
    now_min -= T[2];
    Q[2].push(now_min);
    ans = max(ans, -now_min - ti);
  }
  cout << ans << endl;
}
int main() {
  int i, j;
  for (i = 0; i < 3; ++i) cin >> K[i];
  for (i = 0; i < 3; ++i) cin >> T[i];
  cin >> n;
  for (i = 0; i < 3; ++i) K[i] = min(K[i], n);
  gao();
  return 0;
}
