#include <bits/stdc++.h>
using namespace std;
void change(vector<long long> &a, int k, int t) {
  int n = a.size();
  for (int i = 0; i < k && i < n; i++) a[i] += t;
  for (int i = k; i < n; i++) {
    if (a[i - k] > a[i]) a[i] = a[i - k];
    a[i] += t;
  }
}
int main() {
  int k1, k2, k3;
  int t1, t2, t3;
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3;
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  vector<long long> b;
  b = a;
  change(b, k1, t1);
  change(b, k2, t2);
  change(b, k3, t3);
  long long ans = 0;
  for (int i = 0; i < n; i++)
    if (ans < b[i] - a[i]) ans = b[i] - a[i];
  cout << ans << endl;
  return 0;
}
