#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const int ARRIVE = 0;
const int LEAVE = 1;
int n;
int stg[N], arrv[N];
int k[3], t[3], use[3];
queue<int> wait[3];
int main(void) {
  priority_queue<pair<long long, pair<int, int> > > q;
  long long ans = 0;
  for (int i = 0; i < 3; ++i) {
    cin >> k[i];
    use[i] = 0;
  }
  for (int i = 0; i < 3; ++i) cin >> t[i];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> arrv[i];
    q.push(make_pair(-arrv[i], make_pair(ARRIVE, i)));
  }
  fill_n(stg, n, 0);
  while (!q.empty()) {
    pair<long long, pair<int, int> > p = q.top();
    q.pop();
    if (p.second.first == ARRIVE) {
      stg[p.second.second] = 0;
      if (use[0] == k[0])
        wait[0].push(p.second.second);
      else {
        ++use[0];
        q.push(make_pair(p.first - t[0], make_pair(LEAVE, p.second.second)));
      }
    } else if (p.second.first == LEAVE) {
      ++stg[p.second.second];
      int s = stg[p.second.second];
      --use[s - 1];
      if (wait[s - 1].size() > 0) {
        int nex = wait[s - 1].front();
        wait[s - 1].pop();
        ++use[s - 1];
        q.push(make_pair(p.first - t[s - 1], make_pair(LEAVE, nex)));
      }
      if (s == 3) {
        ans = max(ans, -p.first - arrv[p.second.second]);
      } else {
        if (use[s] == k[s])
          wait[s].push(p.second.second);
        else {
          ++use[s];
          q.push(make_pair(p.first - t[s], make_pair(LEAVE, p.second.second)));
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
