#include <bits/stdc++.h>
using namespace std;
int k1, k2, k3;
int t1, t2, t3;
int n;
long long c[100000], c2[100000];
long long q[200000];
void proc(int k, long long t) {
  int p = 0, s = 0;
  for (int i = 0; i < n; i++) {
    if (i && c[i - 1] > c[i]) c[i] = c[i - 1];
    while (p < s && q[p] <= c[i]) {
      k++;
      p++;
    }
    if (k) {
      k--;
      q[s++] = c[i] + t;
    } else {
      c[i] = q[p++];
      q[s++] = c[i] + t;
    }
  }
}
int main() {
  scanf("%d%d%d", &k1, &k2, &k3);
  scanf("%d%d%d", &t1, &t2, &t3);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", c + i);
  memmove(c2, c, n * sizeof(c2[0]));
  proc(k1, t1);
  proc(k2, t2);
  proc(k3, t3);
  long long mx = -1;
  for (int i = 0; i < n; i++) mx = max(mx, c[i] - c2[i]);
  cout << mx + (long long)t1 + (long long)t2 + (long long)t3;
  return 0;
}
