#include <bits/stdc++.h>
using namespace std;
const int h = 111111;
int t[3], k[3];
int n, c[h];
priority_queue<pair<long long, int> > w[3], e[3];
int main() {
  for (int i = (0), _b = (3); i < _b; ++i) scanf("%d", k + i);
  for (int i = (0), _b = (3); i < _b; ++i) scanf("%d", t + i);
  scanf("%d", &n);
  for (int i = (0), _b = (n); i < _b; ++i) scanf("%d", c + i);
  for (int i = (0), _b = (n); i < _b; ++i)
    w[0].push(pair<long long, int>(-c[i], -i));
  long long ans = 0;
  bool ok = true;
  while (true) {
    long long tt = 1000000000000000000LL;
    for (int i = (0), _b = (3); i < _b; ++i) {
      if (ok && !w[i].empty()) tt = min(tt, -w[i].top().first);
      if (!e[i].empty()) tt = min(tt, -e[i].top().first);
    }
    if (tt == 1000000000000000000LL) break;
    ok = false;
    pair<long long, int> u;
    for (int i = (0), _b = (3); i < _b; ++i)
      if (!e[i].empty()) {
        u = e[i].top();
        if (-u.first > tt) continue;
        ok = true;
        e[i].pop();
        ++k[i];
        if (i != 2)
          w[i + 1].push(pair<long long, int>(u.first, u.second));
        else
          ans = max(ans, -u.first - c[-u.second]);
      }
    for (int i = (0), _b = (3); i < _b; ++i)
      if (k[i] > 0 && !w[i].empty()) {
        u = w[i].top();
        if (-u.first > tt) continue;
        ok = true;
        w[i].pop();
        --k[i];
        e[i].push(pair<long long, int>(-tt - t[i], u.second));
      }
  }
  cout << ans << endl;
  return 0;
}
