#include <bits/stdc++.h>
using namespace std;
long long int A[4][100000], K[3], T[3];
void doit(long long int *s, long long int *d, int n, int k, int t) {
  int i;
  for (i = 0; i < n && i < k; i++) d[i] = s[i] + t;
  for (; i < n; i++)
    if (s[i] >= d[i - k])
      d[i] = s[i] + t;
    else
      d[i] = d[i - k] + t;
}
int main(int argc, char *argv[]) {
  int n, i;
  long long int mx = 0;
  cin >> K[0] >> K[1] >> K[2];
  cin >> T[0] >> T[1] >> T[2];
  cin >> n;
  for (i = 0; i < n; i++) cin >> A[0][i];
  for (i = 0; i < 3; i++) doit(A[i], A[i + 1], n, K[i], T[i]);
  for (i = 0; i < n; i++)
    if (mx < A[3][i] - A[0][i]) mx = A[3][i] - A[0][i];
  cout << mx;
  return 0;
}
