#include <bits/stdc++.h>
using namespace std;
struct info {
  long long s, e;
};
long long wait[100007];
info per[100007];
int k1, k2, k3;
int t1, t2, t3;
int n;
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  memset(wait, 0, sizeof(wait));
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> per[i].s;
    per[i].e = per[i].s + t1;
  }
  for (int i = 0; i < n; ++i) {
    if (i - k1 >= 0 && per[i - k1].e > per[i].s) {
      wait[i] += per[i - k1].e - per[i].s;
      per[i].s = per[i - k1].e;
      per[i].e = per[i].s + t1;
    }
  }
  for (int i = 0; i < n; ++i) {
    per[i].s = per[i].e;
    per[i].e = per[i].s + t2;
  }
  for (int i = 0; i < n; ++i) {
    if (i - k2 >= 0 && per[i - k2].e > per[i].s) {
      wait[i] += per[i - k2].e - per[i].s;
      per[i].s = per[i - k2].e;
      per[i].e = per[i].s + t2;
    }
  }
  for (int i = 0; i < n; ++i) {
    per[i].s = per[i].e;
    per[i].e = per[i].s + t3;
  }
  for (int i = 0; i < n; ++i) {
    if (i - k3 >= 0 && per[i - k3].e > per[i].s) {
      wait[i] += per[i - k3].e - per[i].s;
      per[i].s = per[i - k3].e;
      per[i].e = per[i].s + t3;
    }
  }
  long long mx = 0;
  for (int i = 0; i < n; ++i) mx = max(wait[i], mx);
  cout << mx + t1 + t2 + t3 << endl;
  return 0;
}
