#include <bits/stdc++.h>
using namespace std;
enum { COME = 0, PASS1 = 1, PASS2 = 2, PASS3 = 3 };
int n, k1, k2, k3, t1, t2, t3;
int main() {
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3 >> n;
  priority_queue<pair<long long, int>, vector<pair<long long, int> >,
                 greater<pair<long long, int> > >
      pq;
  vector<int> c(n);
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    pq.push(make_pair(c[i], COME * n + i));
  }
  int f1 = k1, f2 = k2, f3 = k3;
  queue<int> q1, q2, q3;
  long long ans = 0;
  while (!pq.empty()) {
    pair<long long, int> e = pq.top();
    pq.pop();
    int t = e.second / n;
    int id = e.second % n;
    if (t == COME)
      q1.push(id);
    else if (t == PASS1) {
      f1++;
      q2.push(id);
    } else if (t == PASS2) {
      f2++;
      q3.push(id);
    } else {
      f3++;
      ans = max(ans, e.first - c[id]);
    }
    while (f1 && !q1.empty()) {
      f1--;
      pq.push(make_pair(e.first + t1, PASS1 * n + q1.front()));
      q1.pop();
    }
    while (f2 && !q2.empty()) {
      f2--;
      pq.push(make_pair(e.first + t2, PASS2 * n + q2.front()));
      q2.pop();
    }
    while (f3 && !q3.empty()) {
      f3--;
      pq.push(make_pair(e.first + t3, PASS3 * n + q3.front()));
      q3.pop();
    }
  }
  cout << ans << '\n';
  return 0;
}
