#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
int k[3], t[3];
long long c[maxn];
vector<std::deque<pair<long long, int> > > q;
int main() {
  int i, j;
  for (i = 0; i < (int)(3); ++i) scanf("%d", &k[i]);
  for (i = 0; i < (int)(3); ++i) scanf("%d", &t[i]);
  int n;
  scanf("%d", &n);
  q.resize(3);
  for (i = 0; i < (int)(3); ++i) {
    k[i] = min(k[i], n);
    q[i].push_back(make_pair(0, k[i]));
  }
  long long ans = 0;
  for (i = 0; i < (int)(n); ++i) {
    scanf("%I64d", &c[i]);
    long long tmp = c[i];
    for (j = 0; j < (int)(3); ++j) {
      int sum = 0;
      while (!q[j].empty() && q[j].front().first < c[i]) {
        sum += q[j].front().second;
        q[j].pop_front();
      }
      if (sum > 0) q[j].push_front(make_pair(c[i], sum));
      c[i] = q[j].front().first + (long long)t[j];
      if (q[j].front().second == 1)
        q[j].pop_front();
      else
        --q[j].front().second;
      if (!q[j].empty() && q[j].back().first == c[i])
        ++q[j].back().second;
      else
        q[j].push_back(make_pair(c[i], 1));
    }
    ans = max(ans, c[i] - tmp);
  }
  printf("%I64d", ans);
  return 0;
}
