#include <bits/stdc++.h>
using namespace std;
long long a[100000], b[100000];
int n;
void f(int k, long long t) {
  queue<int> q;
  k = min(k, n);
  int i = 0;
  for (i = 0; i < k; i++) {
    q.push(i);
    a[i] += t;
  }
  while (i < n) {
    int p = q.front();
    q.pop();
    q.push(i);
    a[i] = max(a[i], a[p]) + t;
    i++;
  }
}
int main() {
  int k1, k2, k3;
  long long t1, t2, t3;
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  f(k1, t1);
  f(k2, t2);
  f(k3, t3);
  long long ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, a[i] - b[i]);
  cout << ans << endl;
  return 0;
}
