#include <bits/stdc++.h>
using namespace std;
const int inf = 1999999999;
const double pi = acos(-1.0);
const double eps = 1e-10;
char gc() {
  char c;
  while (isspace(c = getchar()))
    ;
  return c;
}
int gs(char* s) {
  gets(s);
  int l = strlen(s);
  while (l && isspace(s[l - 1])) s[--l] = 0;
  return l;
}
int main() {
  int k[3], t[3];
  for (int i = 0; i < 3; i++) scanf("%d", &k[i]);
  for (int i = 0; i < 3; i++) scanf("%d", &t[i]);
  int n;
  scanf("%d", &n);
  queue<long long> q[3];
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < k[i] && j < n; ++j) q[i].push(0);
  long long mx = 0;
  for (int i = 0; i < n; ++i) {
    long long a;
    scanf("%lld", &a);
    long long b = a;
    for (int j = 0; j < 3; ++j) {
      b = max(b, q[j].front()) + t[j];
      q[j].pop();
      q[j].push(b);
    }
    mx = max(mx, b - a);
  }
  cout << mx;
}
