#include <bits/stdc++.h>
using namespace std;
queue<long long> q[5];
long long k[5], t[5];
long long n;
long long a[100000];
inline void f(int i) {
  if (q[i].front() == 0)
    q[i + 1].push(0);
  else
    q[i + 1].push(max(q[i + 1].front(), q[i].front()) + t[i + 1]);
  q[i].pop();
}
int main() {
  cin >> k[1] >> k[2] >> k[3];
  cin >> t[1] >> t[2] >> t[3];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    q[0].push(a[i]);
  }
  for (int i = 1; i <= 3; ++i) k[i] = min(k[i], n);
  for (int i = 1; i <= 3; ++i)
    for (int j = 0; j < k[i]; ++j) q[i].push(0);
  for (int i = 0; i <= 3; ++i)
    while (!q[i].empty())
      for (int j = i; j <= 3; ++j) f(j);
  while (q[4].front() == 0) q[4].pop();
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    long long time = q[4].front() - a[i];
    q[4].pop();
    ans = max(ans, time);
  }
  cout << ans;
  return 0;
}
