#include <bits/stdc++.h>
using namespace std;
int c[100000];
int ci = 0;
long long res[100000];
int main() {
  int k[3];
  int t[3];
  int n;
  scanf("%d%d%d", &k[0], &k[1], &k[2]);
  scanf("%d%d%d", &t[0], &t[1], &t[2]);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", c + i);
  }
  set<long long> tq;
  queue<int> pq[3];
  queue<pair<long long, int> > q[3];
  int qsize[4] = {};
  pair<long long, int> v;
  long long curt;
  for (int i = 0; i < n; i++) {
    res[i] = -c[i];
    tq.insert(c[i]);
  }
  while (!tq.empty()) {
    curt = *(tq.begin());
    tq.erase(tq.begin());
    while (ci < n && c[ci] <= curt) {
      pq[0].push(ci);
      ci++;
    }
    while (!q[0].empty() && q[0].front().first <= curt) {
      v = q[0].front();
      q[0].pop();
      qsize[0]--;
      pq[1].push(v.second);
    }
    while (!q[1].empty() && q[1].front().first <= curt) {
      v = q[1].front();
      q[1].pop();
      qsize[1]--;
      pq[2].push(v.second);
    }
    while (!q[2].empty() && q[2].front().first <= curt) {
      v = q[2].front();
      q[2].pop();
      qsize[2]--;
      res[v.second] += curt;
    }
    while (!pq[0].empty() && qsize[0] < k[0]) {
      v.second = pq[0].front();
      pq[0].pop();
      v.first = curt + t[0];
      q[0].push(v);
      qsize[0]++;
      tq.insert(v.first);
    }
    while (!pq[1].empty() && qsize[1] < k[1]) {
      v.second = pq[1].front();
      pq[1].pop();
      v.first = curt + t[1];
      q[1].push(v);
      qsize[1]++;
      tq.insert(v.first);
    }
    while (!pq[2].empty() && qsize[2] < k[2]) {
      v.second = pq[2].front();
      pq[2].pop();
      v.first = curt + t[2];
      q[2].push(v);
      qsize[2]++;
      tq.insert(v.first);
    }
  }
  long long result = -1;
  for (int i = 0; i < n; i++) {
    result = max(result, res[i]);
  }
  cout << result << endl;
  return 0;
}
