#include <bits/stdc++.h>
using namespace std;
long long n, c[100000], A[100000], B[100000], C[100000];
long long q[100000];
void solve(long long *a, long long *r, long long k, long long t) {
  long long tm = 0, hd = 0, tl = 0, s = 0;
  for (int i = 0; i < n; i++) {
    while (hd < tl && tm >= q[hd]) r[s++] = q[hd++];
    if (tl - hd < k)
      q[tl++] = max(tm, a[i]) + t;
    else
      tm = q[hd], i--;
  }
  while (hd < tl) r[s++] = q[hd++];
}
void run() {
  long long k1, k2, k3, t1, t2, t3;
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> c[i];
  solve(c, A, k1, t1);
  solve(A, B, k2, t2);
  solve(B, C, k3, t3);
  long long ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, C[i] - c[i]);
  cout << ans << endl;
}
int main() {
  run();
  return 0;
}
