#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> k(3), t(3);
  cin >> k[0] >> k[1] >> k[2] >> t[0] >> t[1] >> t[2] >> n;
  priority_queue<long long, vector<long long>, greater<long long> > uncoming;
  for (int i = 0; i < n; ++i) {
    int c;
    cin >> c;
    uncoming.push(c);
  }
  vector<priority_queue<long long, vector<long long>, greater<long long> > >
      waiting(3);
  vector<priority_queue<pair<long long, long long>,
                        vector<pair<long long, long long> >,
                        greater<pair<long long, long long> > > >
      processing(3);
  long long max_time = 0;
  while (uncoming.size() + processing[0].size() + processing[1].size() +
             processing[2].size() >
         0) {
    vector<pair<long long, long long> > tops;
    if (uncoming.size() > 0) {
      tops.push_back(make_pair(uncoming.top(), -1));
    }
    if (processing[0].size() > 0) {
      tops.push_back(make_pair(processing[0].top().first, 0));
    }
    if (processing[1].size() > 0) {
      tops.push_back(make_pair(processing[1].top().first, 1));
    }
    if (processing[2].size() > 0) {
      tops.push_back(make_pair(processing[2].top().first, 2));
    }
    sort(tops.begin(), tops.end());
    for (int i = 0; i < tops.size(); ++i) {
      if (tops[0].first == tops[i].first) {
        if (tops[i].second == -1) {
          while ((!uncoming.empty()) && (uncoming.top() == tops[i].first)) {
            waiting[0].push(uncoming.top());
            uncoming.pop();
          }
        } else {
          while ((!processing[tops[i].second].empty()) &&
                 (processing[tops[i].second].top().first == tops[i].first)) {
            if (tops[i].second == 2) {
              max_time =
                  max(max_time,
                      tops[i].first - processing[tops[i].second].top().second);
            } else {
              waiting[tops[i].second + 1].push(
                  processing[tops[i].second].top().second);
            }
            processing[tops[i].second].pop();
          }
        }
      }
    }
    for (int i = 0; i < 3; ++i) {
      while ((waiting[i].size() > 0) && (processing[i].size() < k[i])) {
        processing[i].push(make_pair(tops[0].first + t[i], waiting[i].top()));
        waiting[i].pop();
      }
    }
  }
  cout << max_time;
  return 0;
}
