#include <bits/stdc++.h>
using namespace std;
int main() {
  int k[3], t[3];
  int N;
  pair<long long, long long> c[100000];
  queue<pair<long long, long long> > in[4], out[4];
  int i, j;
  long long x;
  pair<long long, long long> tmp;
  for (i = 0; i < 3; i++) scanf("%d", &k[i]);
  for (i = 0; i < 3; i++) scanf("%d", &t[i]);
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &j);
    c[i] = pair<long long, long long>(j + 0LL, 0LL);
  }
  sort(c, c + N);
  for (i = 0; i < N; i++) in[0].push(c[i]);
  while (in[3].size() < N) {
    x = (1LL << 60);
    for (i = 0; i < 3; i++)
      if (!out[i].empty()) x = min(x, out[i].front().first);
    x %= (1LL << 60);
    for (i = 0; i < 3; i++) {
      while (!out[i].empty() && out[i].front().first == x) {
        in[i + 1].push(out[i].front());
        out[i].pop();
        k[i]++;
      }
    }
    for (i = 0; i < 3; i++) {
      while (!in[i].empty() && k[i]) {
        k[i]--;
        tmp = in[i].front();
        in[i].pop();
        tmp.second += max(0LL, x - tmp.first) + t[i];
        tmp.first = max(tmp.first, x);
        tmp.first += t[i];
        out[i].push(tmp);
      }
    }
  }
  x = 0;
  while (!in[3].empty()) {
    x = max(x, in[3].front().second);
    in[3].pop();
  }
  cout << x << endl;
  return 0;
}
