#include <bits/stdc++.h>
using namespace std;
int k1, k2, k3, t1, t2, t3;
void wait() {
  getchar();
  getchar();
}
vector<long long> go(vector<long long> a, int k, int t) {
  vector<long long> ans;
  for (int i = 0; i < a.size(); i++) {
    if (i < k)
      ans.push_back(a[i] + t);
    else
      ans.push_back(max(a[i], ans[i - k]) + t);
  }
  return ans;
}
int main() {
  int n;
  vector<long long> a, d1, d2, d3;
  long long m = -1;
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  d1 = go(a, k1, t1);
  d2 = go(d1, k2, t2);
  d3 = go(d2, k3, t3);
  for (int i = 0; i < d3.size(); i++) m = max(m, d3[i] - a[i]);
  cout << m;
  wait();
  return 0;
}
