#include <bits/stdc++.h>
using namespace std;
int a[1000000];
pair<unsigned long long, unsigned long long> 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].first = a[i];
    b[i].second = i;
  }
  int i;
  for (i = 0; i < k1 && i < n; i++) b[i].first = b[i].first + t1;
  for (; i < n; i++) {
    b[i].first =
        (b[i].first > b[i - k1].first ? b[i].first : b[i - k1].first) + t1;
  }
  sort(b, b + n);
  for (i = 0; i < k2 && i < n; i++) b[i].first = b[i].first + t2;
  for (; i < n; i++) {
    b[i].first =
        (b[i].first > b[i - k2].first ? b[i].first : b[i - k2].first) + t2;
  }
  sort(b, b + n);
  for (i = 0; i < k3 && i < n; i++) b[i].first = b[i].first + t3;
  for (; i < n; i++) {
    b[i].first =
        (b[i].first > b[i - k3].first ? b[i].first : b[i - k3].first) + t3;
  }
  unsigned long long m = b[0].first - a[b[0].second];
  for (int i = 1; i < n; i++)
    m = (m > b[i].first - a[b[i].second] ? m : b[i].first - a[b[i].second]);
  cout << m << endl;
  return 0;
}
