#include <bits/stdc++.h>
using namespace std;
unsigned long long a[1000000], b[1000000];
int main() {
  unsigned long long k1, k2, k3, t1, t2, t3, n, x;
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3 >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  int i;
  for (i = 0; i < k1 && i < n; i++) b[i] = b[i] + t1;
  for (; i < n; i++) {
    b[i] = (b[i] > b[i - k1] ? b[i] : b[i - k1]) + t1;
  }
  for (i = 0; i < k2 && i < n; i++) b[i] = b[i] + t2;
  for (; i < n; i++) {
    b[i] = (b[i] > b[i - k2] ? b[i] : b[i - k2]) + t2;
  }
  for (i = 0; i < k3 && i < n; i++) b[i] = b[i] + t3;
  for (; i < n; i++) {
    b[i] = (b[i] > b[i - k3] ? b[i] : b[i - k3]) + t3;
  }
  unsigned long long m = b[0] - a[0];
  for (int i = 1; i < n; i++) m = (m > b[i] - a[i] ? m : b[i] - a[i]);
  cout << m << endl;
  return 0;
}
