#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long x1, x2, x3, t1, t2, t3, n;
long long v[100002];
long long sf[100002];
int curr[100005];
set<pair<pair<long long, int>, int> > event;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> x1 >> x2 >> x3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  x1 = min(x1, n);
  x2 = min(x2, n);
  x3 = min(x3, n);
  for (int i = 1; i <= n; ++i) cin >> v[i];
  sort(v + 1, v + n + 1);
  for (int i = 1; i <= n; ++i) event.insert({{v[i], 0}, i});
  set<pair<long long, int> > fr1, fr2, fr3;
  for (int i = 1; i <= x1; ++i) fr1.insert({0, i});
  for (int i = 1; i <= x2; ++i) fr2.insert({0, i});
  for (int i = 1; i <= x3; ++i) fr3.insert({0, i});
  while (!event.empty()) {
    pair<pair<long long, int>, int> x = *event.begin();
    event.erase(x);
    if (x.first.second == -3) {
      sf[x.second] = x.first.first;
      continue;
    }
    if (x.first.second == -2) {
      pair<long long, int> xx = *fr3.begin();
      fr3.erase(xx);
      fr3.insert({max(x.first.first, xx.first) + t3, xx.second});
      event.insert({{max(x.first.first, xx.first) + t3, -3}, x.second});
      continue;
    }
    if (x.first.second == -1) {
      pair<long long, int> xx = *fr2.begin();
      fr2.erase(xx);
      fr2.insert({max(x.first.first, xx.first) + t2, xx.second});
      event.insert({{max(x.first.first, xx.first) + t2, -2}, x.second});
      continue;
    }
    if (x.first.second == 0) {
      pair<long long, int> xx = *fr1.begin();
      fr1.erase(xx);
      fr1.insert({max(x.first.first, xx.first) + t1, xx.second});
      event.insert({{max(x.first.first, xx.first) + t1, -1}, x.second});
      continue;
    }
  }
  long long mx = 0;
  for (int i = 1; i <= n; ++i) {
    mx = max(mx, sf[i] - v[i]);
  }
  cout << mx;
  return 0;
}
