#include <bits/stdc++.h>
using namespace std;
int main() {
  int K1, K2, K3;
  while (cin >> K1 >> K2 >> K3) {
    int T1, T2, T3;
    cin >> T1 >> T2 >> T3;
    int N;
    cin >> N;
    vector<int> C;
    C.resize(N);
    for (int i = 0; i < (int)(N); i++) scanf("%d", &C[i]);
    queue<long long> q;
    vector<long long> D;
    D.resize(N);
    for (int i = 0; i < (int)(N); i++) {
      long long start = C[i];
      if (q.size() >= K1) {
        start = max(start, q.front());
        q.pop();
      }
      D[i] = start + T1;
      q.push(start + T1);
    }
    vector<long long> E;
    E.resize(N);
    q = queue<long long>();
    for (int i = 0; i < (int)(N); i++) {
      long long start = D[i];
      if (q.size() >= K2) {
        start = max(start, q.front());
        q.pop();
      }
      E[i] = start + T2;
      q.push(start + T2);
    }
    vector<long long> F;
    F.resize(N);
    q = queue<long long>();
    for (int i = 0; i < (int)(N); i++) {
      long long start = E[i];
      if (q.size() >= K3) {
        start = max(start, q.front());
        q.pop();
      }
      F[i] = start + T3;
      q.push(start + T3);
    }
    long long res = 0;
    for (int i = 0; i < (int)(N); i++) {
      res = max(res, F[i] - C[i]);
    }
    cout << res << endl;
  }
  return 0;
}
