#include <bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<long long, vector<long long>, greater<long long> > q1, q2, q3;
  int k1, k2, k3;
  scanf("%d%d%d", &k1, &k2, &k3);
  int t1, t2, t3;
  scanf("%d%d%d", &t1, &t2, &t3);
  int n;
  scanf("%d", &n);
  k1 = min(k1, n);
  k2 = min(k2, n);
  k3 = min(k3, n);
  for (int i = 0; i < (k1); i++) q1.push(0);
  for (int i = 0; i < (k2); i++) q2.push(0);
  for (int i = 0; i < (k3); i++) q3.push(0);
  long long res = 0;
  for (int i = 0; i < (n); i++) {
    int t;
    scanf("%d", &t);
    long long cur = q1.top();
    q1.pop();
    long long T = (long long)t;
    cur = max(cur, T);
    cur += t1;
    q1.push(cur);
    long long cur2 = q2.top();
    q2.pop();
    cur2 = max(cur, cur2);
    cur2 += t2;
    q2.push(cur2);
    long long cur3 = q3.top();
    q3.pop();
    cur3 = max(cur2, cur3);
    cur3 += t3;
    q3.push(cur3);
    res = max(res, cur3 - T);
  }
  cout << res << endl;
  return 0;
}
