#include <bits/stdc++.h>
using namespace std;
int k[4];
long long t[4];
int main() {
  int n;
  cin >> k[0] >> k[1] >> k[2] >> t[0] >> t[1] >> t[2] >> n;
  priority_queue<long long, vector<long long>, greater<long long> > q[4];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x;
    y = x;
    for (int j = 0; j < 3; j++) {
      if (k[j]) {
        k[j]--;
        x += t[j];
        q[j].push(x);
      } else {
        long long tt = q[j].top();
        q[j].pop();
        x = max(x, tt);
        x += t[j];
        q[j].push(x);
      }
    }
    ans = max(ans, x - y);
  }
  cout << ans << endl;
  return 0;
}
