#include <bits/stdc++.h>
using namespace std;
int k[3], t[3];
int n;
long long start[100005];
long long intime[100005][3];
int cmp(const void *aa, const void *bb) {
  long long *a = (long long *)aa, *b = (long long *)bb;
  return *a - *b;
}
int main() {
  long long maxCost = -1;
  scanf("%d%d%d", &k[0], &k[1], &k[2]);
  scanf("%d%d%d", &t[0], &t[1], &t[2]);
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &start[i]);
  qsort(start, n, sizeof(long long), cmp);
  for (int i = 0; i < n; i++) {
    if (i - k[0] >= 0)
      intime[i][0] = max(intime[i - k[0]][0] + t[0], start[i]);
    else
      intime[i][0] = start[i];
    if (i - k[1] >= 0)
      intime[i][1] = max(intime[i - k[1]][1] + t[1], intime[i][0] + t[0]);
    else
      intime[i][1] = intime[i][0] + t[0];
    if (i - k[2] >= 0)
      intime[i][2] = max(intime[i - k[2]][2] + t[2], intime[i][1] + t[1]);
    else
      intime[i][2] = intime[i][1] + t[1];
    maxCost = max(maxCost, intime[i][2] + t[2] - start[i]);
  }
  printf("%I64d\n", maxCost);
  return 0;
}
