#include <bits/stdc++.h>
using namespace std;
long long k1, k2, k3;
long long t1, t2, t3;
long long n;
long long t[101000];
long long nt[101000];
multiset<long long> tk;
void solve(long long num, long long tm) {
  tk.clear();
  vector<long long> rs;
  int cur = 0;
  while (cur < n) {
    if (tk.size() < num)
      tk.insert(nt[cur] + tm);
    else {
      long long curr = *tk.begin();
      tk.erase(tk.begin());
      rs.push_back(curr);
      tk.insert(max(curr, nt[cur]) + tm);
    }
    cur++;
  }
  for (multiset<long long>::iterator it = tk.begin(); it != tk.end(); it++)
    rs.push_back(*it);
  for (int i = 0; i < n; i++) nt[i] = rs[i];
}
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i], nt[i] = t[i];
  long long res = 0;
  solve(k1, t1);
  solve(k2, t2);
  solve(k3, t3);
  for (int i = 0; i < n; i++) res = max(res, nt[i] - t[i]);
  cout << res << endl;
  return 0;
}
