#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, k[3], t[3], c[N];
long long solve() {
  long long ret = 0;
  queue<int> wait[3];
  queue<pair<long long, int> > que[3];
  int in = 0, out = 0;
  long long T = 0;
  while (out < n) {
    for (int i = (0); i < (3); ++i) {
      while (!que[i].empty() && que[i].front().first <= T) {
        if (i == 2) {
          ++out;
          ret = max(ret, que[i].front().first - c[que[i].front().second]);
        } else {
          wait[i + 1].push(que[i].front().second);
        }
        que[i].pop();
      }
    }
    while (in < n && c[in] <= T) wait[0].push(in++);
    for (int i = (0); i < (3); ++i) {
      while (((int)(que[i]).size()) < k[i] && !wait[i].empty()) {
        que[i].push(make_pair(T + t[i], wait[i].front()));
        wait[i].pop();
      }
    }
    T = 1e18;
    if (in < n && T > c[in]) T = c[in];
    for (int i = (0); i < (3); ++i)
      if (!que[i].empty() && que[i].front().first < T) T = que[i].front().first;
  }
  return ret;
}
int main() {
  for (int i = (0); i < (3); ++i) scanf("%d", k + i);
  for (int i = (0); i < (3); ++i) scanf("%d", t + i);
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%d", c + i);
  sort(c, c + n);
  cout << solve() << endl;
  return 0;
}
