#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
long long K[3];
long long T[3];
int n;
vector<long long> s;
int main() {
  for (int i = 0; i < (int)(3); ++i) scanf("%I64d", &K[i]);
  for (int i = 0; i < (int)(3); ++i) scanf("%I64d", &T[i]);
  scanf("%d", &n);
  s.resize(n);
  for (int i = 0; i < (int)(n); ++i) scanf("%I64d", &s[i]);
  vector<long long> t = s;
  for (int k = 0; k < (int)(3); ++k) {
    vector<long long> cc(min(n, (int)K[k]), 0);
    int p = 0;
    for (int i = 0; i < (int)(n); ++i) {
      t[i] = max(cc[p], t[i]) + T[k];
      cc[p] = t[i];
      p = (p + 1) % cc.size();
    }
  }
  long long res = 0;
  for (int i = 0; i < (int)(n); ++i) {
    res = max(res, t[i] - s[i]);
  }
  printf("%I64d\n", res);
  return 0;
}
