#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
int k[3], t[3];
int n;
long long c[100100];
queue<long long> q1[3];
queue<pair<long long, long long> > q2[3];
int main() {
  cin >> k[0] >> k[1] >> k[2];
  cin >> t[0] >> t[1] >> t[2];
  cin >> n;
  c[n] = (1ll << 62);
  long long ans = -1;
  for (int i = 0; i < int(n); i++) scanf("%d", &c[i]);
  int t1 = 0, kol = 0;
  long long t2 = 0;
  while (kol < n) {
    long long ans1 = c[t1], ans2 = -1;
    for (int i = 0; i < int(3); i++)
      if (!q2[i].empty()) {
        if (ans1 > q2[i].front().second) {
          ans1 = q2[i].front().second;
          ans2 = i;
        }
      }
    t2 = ans1;
    if (ans2 == -1)
      q1[0].push(c[t1++]);
    else {
      pair<long long, long long> k1 = q2[ans2].front();
      q2[ans2].pop();
      if (ans2 != 2)
        q1[ans2 + 1].push(k1.first);
      else {
        ans = max(ans, k1.second - k1.first);
        kol++;
      }
    }
    for (int i = 0; i < int(3); i++) {
      if (q1[i].empty()) continue;
      if (q2[i].size() >= k[i]) continue;
      while (!q1[i].empty() && !(q2[i].size() >= k[i])) {
        q2[i].push(make_pair(q1[i].front(), t2 + t[i]));
        q1[i].pop();
      }
    }
  }
  cout << ans << endl;
  return 0;
}
