#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename first>
inline first abs(const first& a) {
  return a < 0 ? -a : a;
}
template <typename first>
inline first sqr(const first& a) {
  return a * a;
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
const int INF = 1000 * 1000 * 1000;
const int N = 100 * 1000 + 13;
int k[3];
int t[3];
int n;
int a[N];
multiset<long long> cnt[3];
int main() {
  for (int i = 0; i < int(3); i++) cin >> k[i];
  for (int i = 0; i < int(3); i++) cin >> t[i];
  cin >> n;
  for (int i = 0; i < int(3); i++) {
    for (int j = 0; j < int(min(k[i], n)); j++) cnt[i].insert(0);
  }
  long long ans = 0;
  for (int i = 0; i < int(n); i++) {
    int curt;
    scanf("%d", &curt);
    long long fint = curt;
    long long stt = curt;
    for (int j = 0; j < int(3); j++) {
      multiset<long long>::iterator it = cnt[j].lower_bound(fint + 1);
      if (it != cnt[j].begin()) {
        it--;
        assert(*it <= fint);
      }
      long long nowt = *it;
      multiset<long long>::iterator jt = it;
      jt++;
      cnt[j].erase(it, jt);
      fint = max(fint, nowt);
      fint += t[j];
      cnt[j].insert(fint);
    }
    ans = max(ans, fint - stt);
  }
  cout << ans << endl;
  return 0;
}
