#include <bits/stdc++.h>
using namespace std;
int t[3], num[3];
int n, c[100050];
long long hh[3][100050];
void heapify(int &size, long long *heap, int k) {
  int l, r, idx;
  l = k * 2;
  r = l + 1;
  if (l <= size && heap[l] < heap[k])
    idx = l;
  else
    idx = k;
  if (r <= size && heap[r] < heap[idx]) idx = r;
  if (idx ^ k) {
    swap(heap[idx], heap[k]);
    heapify(size, heap, idx);
  }
}
long long cal() {
  long long now, ans = 0;
  memset(hh, 0, sizeof(hh));
  for (int i = 1; i <= n; i++) {
    now = c[i] - 1;
    for (int j = 0; j < 3; j++) {
      now = max(now, hh[j][1]);
      hh[j][1] = now + t[j];
      now += t[j];
      heapify(num[j], hh[j], 1);
    }
    ans = max(ans, now - (c[i] - 1));
  }
  return ans;
}
int main() {
  while (scanf("%d%d%d", num + 0, num + 1, num + 2) == 3) {
    for (int i = 0; i < 3; i++) scanf("%d", t + i);
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", c + i);
    for (int i = 0; i < 3; i++)
      if (num[i] > n) num[i] = n;
    cout << cal() << endl;
  }
  return 0;
}
