#include <bits/stdc++.h>
using namespace std;
int t1, t2, t3;
int k1, k2, k3, n;
pair<long long, long long> c[100500];
void solve(int k, int t) {
  multiset<long long> S;
  for (int i(0); i < n; ++i) {
    if (S.size() < k) {
      c[i].first += t;
      S.insert(c[i].first);
    } else {
      auto l = S.begin();
      c[i].first = max(c[i].first, *l);
      S.erase(l);
      c[i].first += t;
      S.insert(c[i].first);
    }
  }
}
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  scanf("%d", &n);
  for (int i(0); i < n; ++i) {
    int x;
    scanf("%d", &x);
    c[i] = {x, x};
  }
  solve(k1, t1);
  solve(k2, t2);
  solve(k3, t3);
  long long res = -1000000000000000000;
  for (int i(0); i < n; ++i) res = max(res, c[i].first - c[i].second);
  cout << res << endl;
  return 0;
}
