#include <bits/stdc++.h>
using namespace std;
const long long NN = 111111;
struct TREE {
  long long v;
  long long id;
} trs[3][NN * 6];
long long f[NN];
long long mymap[3][NN];
void build(long long idx, long long L, long long R, TREE tr[], int wd) {
  if (L == R) {
    mymap[wd][L] = idx;
    tr[idx].id = L;
    return;
  }
  long long mid = L + R >> 1;
  build(idx << 1, L, mid, tr, wd);
  build(idx << 1 | 1, mid + 1, R, tr, wd);
  tr[idx].v = min(tr[idx << 1].v, tr[idx << 1 | 1].v);
  tr[idx << 1].v < tr[idx << 1 | 1].v ? tr[idx].id = tr[idx << 1].id
                                      : tr[idx].id = tr[idx << 1 | 1].id;
}
void update(long long idx, long long L, long long R, TREE tr[], long long id,
            long long to) {
  if (id == L && L == R) {
    tr[idx].v = to;
    return;
  }
  long long mid = L + R >> 1;
  if (id <= mid)
    update(idx << 1, L, mid, tr, id, to);
  else if (id >= mid + 1)
    update(idx << 1 | 1, mid + 1, R, tr, id, to);
  tr[idx].v = min(tr[idx << 1].v, tr[idx << 1 | 1].v);
  tr[idx << 1].v < tr[idx << 1 | 1].v ? tr[idx].id = tr[idx << 1].id
                                      : tr[idx].id = tr[idx << 1 | 1].id;
}
long long que_min(long long idx, long long L, long long R, TREE tr[]) {
  return tr[1].id;
}
int main() {
  long long K1, K2, K3;
  cin >> K1 >> K2 >> K3;
  K1 = min(K1, NN);
  K2 = min(K2, NN);
  K3 = min(K3, NN);
  long long t1, t2, t3;
  cin >> t1 >> t2 >> t3;
  long long n;
  cin >> n;
  build(1, 1, K1, trs[0], 0);
  build(1, 1, K2, trs[1], 1);
  build(1, 1, K3, trs[2], 2);
  long long minn, tmp, maxn;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> f[i];
    long long index = que_min(1, 1, K1, trs[0]);
    minn = trs[0][mymap[0][index]].v;
    maxn = max(f[i], minn);
    update(1, 1, K1, trs[0], index, maxn + t1);
    index = que_min(1, 1, K2, trs[1]);
    minn = trs[1][mymap[1][index]].v;
    maxn = max(maxn + t1, minn);
    update(1, 1, K2, trs[1], index, maxn + t2);
    index = que_min(1, 1, K3, trs[2]);
    minn = trs[2][mymap[2][index]].v;
    maxn = max(maxn + t2, minn);
    update(1, 1, K3, trs[2], index, maxn + t3);
    ans = max(ans, maxn + t3 - f[i]);
  }
  cout << ans << endl;
  return 0;
}
