#include <bits/stdc++.h>
using namespace std;
long long K[4], T[4];
queue<pair<long long, long long> > q[4];
int main() {
  cin >> K[1] >> K[2] >> K[3];
  cin >> T[1] >> T[2] >> T[3];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    q[0].push(make_pair(x, x));
  }
  long long inf = (T[1] + T[2] + T[3]) * 2000000000LL;
  long long res = 0;
  int left = n;
  while (left) {
    pair<long long, int> next[4];
    for (int i = 0; i < 4; ++i)
      if (q[i].empty())
        next[i] = make_pair(inf, i);
      else
        next[i] = make_pair(q[i].front().first, -i);
    sort(next, next + 4);
    int k = -next[0].second;
    if (k == 3) {
      res = max(res, q[3].front().first - q[3].front().second);
      q[3].pop();
      left--;
    } else {
      if (q[k + 1].size() < K[k + 1]) {
        pair<long long, long long> x = q[k].front();
        q[k].pop();
        x.first += T[k + 1];
        q[k + 1].push(x);
      } else {
        q[k].front().first = q[k + 1].front().first;
      }
    }
  }
  cout << res << endl;
  return 0;
}
