#include <bits/stdc++.h>
using namespace std;
const int N = 100500;
long long T[N];
int st[N];
long long c[3], tt[3];
long long curt = 0;
multiset<pair<long long, int> > W[3];
set<pair<long long, int> > ev;
int busy[3] = {0, 0, 0};
void go(int q) {
  if (q == -1 || q == 3 || busy[q] == c[q] || W[q].size() == 0) return;
  int nxt = W[q].begin()->second;
  W[q].erase(W[q].begin());
  busy[q]++;
  ev.insert(make_pair(curt + tt[q], nxt));
}
int main() {
  memset(st, -1, sizeof(st));
  for (int i = 0; i < 3; i++) cin >> c[i];
  for (int i = 0; i < 3; i++) cin >> tt[i];
  int n;
  cin >> n;
  long long t;
  for (int i = 0; i < n; i++) {
    cin >> t;
    T[i] = t;
    ev.insert(make_pair(t, i));
  }
  int q;
  int nxt;
  int s;
  long long ans = 0;
  while (!ev.empty()) {
    t = ev.begin()->first;
    q = ev.begin()->second;
    curt = t;
    ev.erase(ev.begin());
    if (st[q] != -1) busy[st[q]]--;
    go(st[q]);
    st[q]++;
    if (st[q] == 3) {
      ans = max(ans, t - T[q]);
      continue;
    }
    W[st[q]].insert(make_pair(T[q], q));
    go(st[q]);
  }
  cout << ans;
}
