#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:65777216")
using namespace std;
int k1, k2, k3;
int t1, t2, t3;
int a[111111];
long long c[111111];
int n;
long long res;
void solve(int k, int t) {
  queue<long long> q;
  int num = k;
  long long curr = 0;
  for (int i(0); i < (n); i++) {
    curr = max(curr, c[i]);
    if (num == 0) {
      curr = max(curr, q.front());
      q.pop();
      num++;
    }
    num--;
    q.push(curr + t);
    c[i] = curr + t;
    res = max(res, curr + t - a[i]);
  }
}
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i(0); i < (n); i++) {
    int x;
    scanf("%d", &x);
    a[i] = c[i] = x;
  }
  sort(c, c + n);
  solve(k1, t1);
  solve(k2, t2);
  solve(k3, t3);
  cout << res << endl;
  return 0;
}
