#include <bits/stdc++.h>
using namespace std;
template <class T>
void check_max(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
void check_min(T& a, T b) {
  if (a > b) a = b;
}
const int MAXN = 1E5 + 10;
int n;
long long c[4][MAXN];
long long k[3], t[3];
void deal(long long oc[MAXN], long long nc[MAXN], int k, int t) {
  priority_queue<long long, vector<long long>, greater<long long> > pq;
  for (int _t = min(n, k), i = 0; i < _t; i++) pq.push(0);
  for (int _t = n, i = 0; i < _t; i++) {
    long long min_time = pq.top();
    pq.pop();
    nc[i] = max(min_time, oc[i]) + t;
    pq.push(nc[i]);
  }
}
int main() {
  for (int _t = 3, i = 0; i < _t; i++) cin >> k[i];
  for (int _t = 3, i = 0; i < _t; i++) cin >> t[i];
  cin >> n;
  for (int _t = n, i = 0; i < _t; i++) cin >> c[0][i];
  for (int _t = 3, i = 0; i < _t; i++) deal(c[i], c[i + 1], k[i], t[i]);
  long long ans = 0;
  for (int _t = n, i = 0; i < _t; i++) check_max(ans, c[3][i] - c[0][i]);
  cout << ans << endl;
  return 0;
}
