#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:16000000")
#pragma warning(disable : 4996)
const long long inf = 1LL << 60;
const double eps = 1e-9;
int main() {
  long long k[4], t[4];
  memset((k), (0), sizeof(k));
  memset((t), (0), sizeof(t));
  for (int i = (0); i < (3); ++i) cin >> k[i + 1];
  for (int i = (0); i < (3); ++i) cin >> t[i + 1];
  int n;
  cin >> n;
  vector<long long> c(n);
  for (int i = (0); i < (n); ++i) cin >> c[i];
  queue<pair<long long, long long> > Q[4];
  for (int i = (0); i < (n); ++i)
    Q[0].push(pair<long long, long long>(c[i], i));
  vector<long long> times[4];
  long long ans = 0;
  while (1) {
    int mk = -1;
    for (int i = (0); i < (4); ++i)
      if (!Q[i].empty()) {
        if (mk == -1 || Q[i].front() < Q[mk].front()) mk = i;
      }
    if (mk == -1) break;
    pair<long long, long long> cur = Q[mk].front();
    Q[mk].front();
    Q[mk].pop();
    long long curtime = cur.first;
    long long id = cur.second;
    if (mk == 3) {
      ans = max(ans, curtime - c[id]);
    } else {
      long long nexttime = 0;
      if (Q[mk + 1].size() < k[mk + 1]) {
        nexttime = curtime + t[mk + 1];
      } else {
        nexttime = times[mk + 1][times[mk + 1].size() - k[mk + 1]] + t[mk + 1];
      }
      Q[mk + 1].push(pair<long long, long long>(nexttime, id));
      times[mk + 1].push_back(nexttime);
    }
  }
  cout << ans << endl;
  return 0;
}
