#include <bits/stdc++.h>
using namespace std;
int k1, k2, k3, t1, t2, t3, n, x;
vector<pair<long long, int> > a, b;
long long wait[100009], f[100009];
void solve(vector<pair<long long, int> >& a, vector<pair<long long, int> >& b,
           int num, int t) {
  sort(a.begin(), a.end());
  for (int i = 0; i < num; i++) f[i] = a[i].first;
  for (int i = num; i < (int)a.size(); i++)
    f[i] = max(f[i - num] + t, a[i].first);
  b.clear();
  for (int i = 0; i < (int)a.size(); i++) {
    wait[a[i].second] += f[i] - a[i].first;
    b.push_back(make_pair(f[i] + t, a[i].second));
  }
}
int main() {
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3 >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &x), a.push_back(make_pair(x, i));
  k1 = min(k1, n);
  k2 = min(k2, n);
  k3 = min(k3, n);
  solve(a, b, k1, t1);
  solve(b, a, k2, t2);
  solve(a, b, k3, t3);
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, wait[i]);
  printf("%I64d\n", ans + t1 + t2 + t3);
  return 0;
}
