#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
void gen() {
  freopen("input.txt", "w", stdout);
  cout << "10 5 8" << endl;
  cout << "10 10 5" << endl;
  cout << 1000 << endl;
  for (int i = 0; i < 1000; ++i) cout << i + 3 << " ";
  cout << endl;
  exit(0);
}
int main() {
  int k[3];
  cin >> k[0] >> k[1] >> k[2];
  long long t[3];
  cin >> t[0] >> t[1] >> t[2];
  int n;
  cin >> n;
  vector<int> c(n);
  for (int i = 0; i < n; ++i) scanf("%d", &c[i]);
  for (int i = 0; i < 3; ++i) k[i] = min(k[i], n);
  priority_queue<pair<long long, int>, vector<pair<long long, int> >,
                 greater<pair<long long, int> > >
      q;
  for (int i = 0; i < n; ++i) q.push(make_pair(c[i] + 0LL, i + 1));
  vector<int> need(n, 0);
  queue<int> qp[3];
  long long res = 0;
  while (q.size()) {
    pair<long long, int> e = q.top();
    q.pop();
    if (e.second > 0 || e.first < 0) {
      int id = e.second - 1;
      if (e.first < 0) e.first = -e.first - 1 - id;
      int cneed = need[id];
      if (cneed == 3)
        res = max(res, e.first - c[id]);
      else {
        if (k[cneed] > 0) {
          k[cneed]--;
          q.push(make_pair(e.first + t[cneed], -1 - id));
        } else
          qp[cneed].push(id);
      }
    } else {
      int id = -(e.second + 1);
      int cneed = need[id];
      k[cneed]++;
      need[id]++;
      if (need[id] < 3)
        qp[need[id]].push(id);
      else
        q.push(make_pair(e.first, id + 1));
    }
    for (int i = 0; i < 3; ++i)
      if (k[i] > 0 && qp[i].size()) {
        q.push(make_pair(-e.first - 1 - qp[i].front(), +qp[i].front() + 1));
        qp[i].pop();
      }
  }
  cout << res << endl;
  return 0;
}
