#include <bits/stdc++.h>
using namespace std;
const int limite = 1000000;
int n;
long long int cini[limite];
long long int c[limite];
long long int nextc[limite];
void siguiente(long long int k, long long int t) {
  priority_queue<pair<long long int, long long int>,
                 vector<pair<long long int, long long int> >,
                 greater<pair<long long int, long long int> > >
      q;
  q.push(pair<long long int, long long int>(0, k));
  for (int i = 0; i < n; i++) {
    pair<long long int, long long int> p = q.top();
    q.pop();
    nextc[i] = max(c[i], p.first) + t;
    q.push(pair<long long int, long long int>(nextc[i], 1));
    if (p.second > 1)
      q.push(pair<long long int, long long int>(p.first, p.second - 1));
  }
  for (int i = 0; i < n; i++) c[i] = nextc[i];
}
long long int k[4];
long long int t[4];
int main() {
  ios::sync_with_stdio(false);
  for (int i = 0; i < 3; i++) cin >> k[i];
  for (int i = 0; i < 3; i++) cin >> t[i];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> cini[i];
    c[i] = cini[i];
  }
  for (int i = 0; i < 3; i++) siguiente(k[i], t[i]);
  long long int sol = 0;
  for (int i = 0; i < n; i++) sol = max(sol, c[i] - cini[i]);
  cout << sol << endl;
}
