#include <bits/stdc++.h>
using namespace std;
void mytimer(string task) {}
priority_queue<int, vector<int>, greater<int> > qus[3];
priority_queue<pair<long long, pair<int, int> >,
               vector<pair<long long, pair<int, int> > >,
               greater<pair<long long, pair<int, int> > > >
    evs;
int cap[3];
int tim[3];
int cur[3];
void doit(long long t) {
  for (int i = 0; i < (3); ++i) {
    if (cur[i] < cap[i] && qus[i].size()) {
      evs.push(make_pair(t + tim[i], make_pair(i + 1, qus[i].top())));
      qus[i].pop();
      ++cur[i];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  for (int i = 0; i < (3); ++i) cin >> cap[i];
  for (int i = 0; i < (3); ++i) cin >> tim[i];
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    int c;
    cin >> c;
    evs.push(make_pair(1LL * c, make_pair(0, c)));
  }
  long long res = 0;
  while (!evs.empty()) {
    long long t = evs.top().first;
    int q = evs.top().second.first;
    int c = evs.top().second.second;
    evs.pop();
    if (q) --cur[q - 1];
    if (q < 3)
      qus[q].push(c);
    else
      res = max(res, t - c);
    doit(t);
  }
  cout << res;
  return 0;
}
