#include <bits/stdc++.h>
using namespace std;
const long long N = 111111;
long long c[N];
long long n, k1, k2, k3, t1, t2, t3;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3 >> n;
  multiset<long long> s1, s2, s3;
  k1 = min(k1, n);
  k2 = min(k2, n);
  k3 = min(k3, n);
  for (long long i = (1); i <= (k1); i++) {
    s1.insert(0);
  }
  for (long long i = (1); i <= (k2); i++) {
    s2.insert(0);
  }
  for (long long i = (1); i <= (k3); i++) {
    s3.insert(0);
  }
  long long ans = 0;
  for (long long i = (1); i <= (n); i++) {
    cin >> c[i];
    long long f1 = max(c[i], *(s1.begin()));
    s1.erase(s1.begin());
    f1 += t1;
    s1.insert(f1);
    long long f2 = max(f1, *(s2.begin()));
    s2.erase(s2.begin());
    f2 += t2;
    s2.insert(f2);
    long long f3 = max(f2, *(s3.begin()));
    s3.erase(s3.begin());
    f3 += t3;
    s3.insert(f3);
    ans = max(ans, f3 - c[i]);
  }
  cout << ans << "\n";
  return 0;
}
