#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<long long, long long> > q[3];
long long n, k[3], t[3], c[1000005], o[1000005];
int main() {
  for (int i = 0; i < (3); i++) cin >> k[i];
  for (int i = 0; i < (3); i++) cin >> t[i];
  cin >> n;
  for (int i = 0; i < (n); i++) {
    cin >> c[i];
    o[i] = c[i];
  }
  for (int w = 0; w < (3); w++) {
    int i = 0, si = 0;
    for (; i < n && i < k[w]; i++) o[i] = o[i] + t[w];
    for (; i < n; i++, si++)
      if (o[i] <= o[si])
        o[i] = o[si] + t[w];
      else
        o[i] = o[i] + t[w];
  }
  long long maxW = 0;
  for (int i = 0; i < (n); i++)
    maxW = ((maxW) > (o[i] - c[i]) ? (maxW) : (o[i] - c[i]));
  cout << maxW << endl;
  cin >> n;
  return 0;
}
