#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int k1, k2, k3;
int t1, t2, t3;
int n;
int c[N];
int T1[N], T2[N], T3[N];
set<pair<long long, int> > H1, H2, H3;
int main() {
  scanf("%d%d%d", &k1, &k2, &k3);
  scanf("%d%d%d", &t1, &t2, &t3);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  k1 = min(n, k1);
  k2 = min(n, k2);
  k3 = min(n, k3);
  H1.clear();
  H2.clear();
  H3.clear();
  for (int i = 1; i <= k1; i++) H1.insert(make_pair(0LL, i));
  for (int i = 1; i <= k2; i++) H2.insert(make_pair(0LL, i));
  for (int i = 1; i <= k3; i++) H3.insert(make_pair(0LL, i));
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long now = c[i];
    pair<long long, int> tmp = *H1.begin();
    tmp.first = max(tmp.first, now) + t1;
    now = tmp.first;
    H1.erase(H1.begin());
    H1.insert(tmp);
    tmp = *H2.begin();
    tmp.first = max(tmp.first, now) + t2;
    now = tmp.first;
    H2.erase(H2.begin());
    H2.insert(tmp);
    tmp = *H3.begin();
    tmp.first = max(tmp.first, now) + t3;
    now = tmp.first;
    H3.erase(H3.begin());
    H3.insert(tmp);
    ans = max(ans, now - c[i]);
  }
  printf("%I64d\n", ans);
}
