#include <bits/stdc++.h>
using namespace std;
vector<long long> r, a, in;
int n;
void make(vector<long long>& a, long long t, int k) {
  r.clear();
  r.resize(min(k, n) + 1);
  for (int i = 0; i < n; i++) {
    long long p = max(r[(i % k)], a[i]) + t;
    r[(i % k)] = p;
    a[i] = p;
  }
}
int main() {
  int k[4], t[4];
  for (int i = 0; i < 3; i++) cin >> k[i];
  for (int i = 0; i < 3; i++) cin >> t[i];
  cin >> n;
  a.resize(n);
  in.resize(n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) in[i] = a[i];
  for (int i = 0; i < 3; i++) make(a, t[i], k[i]);
  long long maxi = 0;
  for (int i = 0; i < n; i++) maxi = max(a[i] - in[i], maxi);
  cout << maxi;
  return 0;
}
