#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
long long gcd(long long a, long long b) { return a == 0 ? b : gcd(b % a, a); }
string filename = "test";
void get_output(const vector<long long>& in, int k, long long t,
                vector<long long>& out) {
  multiset<long long> next_time;
  int cnt_left = k;
  for (int _n(in.size()), i(0); i < _n; i++) {
    if (cnt_left > 0) {
      out[i] = in[i] + t;
      --cnt_left;
      next_time.insert(out[i]);
    } else {
      multiset<long long>::iterator it = next_time.begin();
      out[i] = (((*it) > (in[i])) ? (*it) : (in[i])) + t;
      next_time.erase(it);
      next_time.insert(out[i]);
    }
  }
}
int main() {
  int k1, k2, k3;
  scanf("%d %d %d", &k1, &k2, &k3);
  int t1, t2, t3;
  scanf("%d %d %d", &t1, &t2, &t3);
  int n;
  scanf("%d", &n);
  vector<int> tmp(n);
  for (int _n(n), i(0); i < _n; i++) {
    scanf("%d", &tmp[i]);
  }
  vector<long long> input0;
  input0.reserve(n);
  for (int _n(n), i(0); i < _n; i++) {
    input0.push_back(tmp[i]);
  }
  vector<long long> output0(n);
  get_output(input0, k1, t1, output0);
  vector<long long> output1(n);
  get_output(output0, k2, t2, output1);
  get_output(output1, k3, t3, output0);
  long long max_val = 0;
  for (int _n(n), i(0); i < _n; i++) {
    long long now = output0[i] - input0[i];
    if (now > max_val) max_val = now;
  }
  cout << max_val << endl;
  return 0;
}
