#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, int> > que;
priority_queue<long long> sev;
long long a[100000];
int main() {
  long long k1, k2, k3, t1, t2, t3, temp;
  int n, i;
  scanf("%I64d%I64d%I64d", &k1, &k2, &k3);
  scanf("%I64d%I64d%I64d", &t1, &t2, &t3);
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%I64d", &a[i]);
    que.push_back(pair<long long, int>(a[i], i));
  }
  if (k1 < n) {
    for (i = 0; i < k1; ++i) sev.push(0);
    for (i = 0; i < n; ++i) {
      if (-sev.top() >= que[i].first)
        que[i].first += -sev.top() - que[i].first + t1;
      else
        que[i].first += t1;
      sev.push(-que[i].first);
      sev.pop();
    }
  } else {
    for (i = 0; i < n; ++i) que[i].first += t1;
  }
  while (!sev.empty()) sev.pop();
  if (k2 < n) {
    for (i = 0; i < k2; ++i) sev.push(0);
    for (i = 0; i < n; ++i) {
      if (-sev.top() >= que[i].first)
        que[i].first += -sev.top() - que[i].first + t2;
      else
        que[i].first += t2;
      sev.push(-que[i].first);
      sev.pop();
    }
  } else {
    for (i = 0; i < n; ++i) que[i].first += t2;
  }
  while (!sev.empty()) sev.pop();
  if (k3 < n) {
    for (i = 0; i < k3; ++i) sev.push(0);
    for (i = 0; i < n; ++i) {
      if (-sev.top() >= que[i].first)
        que[i].first += -sev.top() - que[i].first + t3;
      else
        que[i].first += t3;
      sev.push(-que[i].first);
      sev.pop();
    }
  } else {
    for (i = 0; i < n; ++i) que[i].first += t3;
  }
  long long ans = 0;
  for (i = 0; i < n; ++i) ans = max(ans, que[i].first - a[que[i].second]);
  printf("%I64d\n", ans);
}
