#include <bits/stdc++.h>
using namespace std;
struct person {
  long long arr;
  long long st1, st2, st3;
  long long en;
} p[100010];
long long n, k1, k2, k3, t1, t2, t3;
int main(int argc, char** argv) {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].arr;
  }
  p[1].st1 = p[1].arr;
  p[1].st2 = p[1].st1 + t1;
  p[1].st3 = p[1].st2 + t2;
  p[1].en = p[1].st3 + t3;
  long long ans = p[1].en - p[1].arr;
  for (int i = 2; i <= n; i++) {
    p[i].st1 = p[i].arr;
    if (i > k1) {
      int idx = i - k1;
      p[i].st1 = max(p[i].st1, p[idx].st1 + t1);
    }
    p[i].st2 = p[i].st1 + t1;
    if (i > k2) {
      int idx = i - k2;
      p[i].st2 = max(p[i].st2, p[idx].st2 + t2);
    }
    p[i].st3 = p[i].st2 + t2;
    if (i > k3) {
      int idx = i - k3;
      p[i].st3 = max(p[i].st3, p[idx].st3 + t3);
    }
    p[i].en = p[i].st3 + t3;
    ans = max(ans, p[i].en - p[i].arr);
  }
  cout << ans << endl;
  return 0;
}
