#include <bits/stdc++.h>
using namespace std;
long long k1, k2, k3, t1, t2, t3, n, c[100001], a[100001], ans;
void solve(long long k, long long t) {
  long long cur = 0;
  queue<long long> q;
  for (int i = 1; i <= n; i++) {
    cur = max(cur, c[i]);
    if (!k) {
      cur = max(cur, q.front());
      q.pop();
      k++;
    }
    k--;
    c[i] = cur + t;
    q.push(cur + t);
    ans = max(ans, cur + t - a[i]);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> c[i], a[i] = c[i];
  solve(k1, t1);
  solve(k2, t2);
  solve(k3, t3);
  cout << ans << endl;
  return 0;
}
