#include <bits/stdc++.h>
using namespace std;
struct man {
  long long t[4];
};
long long k[3], t[3];
int n;
vector<man> men;
long long tn = 0;
void pass(int step) {
  queue<long long> q;
  for (int i = 0; i < n; i++) {
    while (q.size() && men[i].t[step] > q.front()) q.pop();
    if (q.size() < k[step]) {
      q.push(men[i].t[step] + t[step]);
      men[i].t[step + 1] = men[i].t[step] + t[step];
      continue;
    }
    while (q.size() > k[step]) q.pop();
    tn = q.front();
    q.pop();
    q.push(tn + t[step]);
    men[i].t[step + 1] = tn + t[step];
  }
}
int main() {
  cin >> k[0] >> k[1] >> k[2];
  cin >> t[0] >> t[1] >> t[2];
  cin >> n;
  men.resize(n);
  for (int i = 0; i < n; i++) cin >> men[i].t[0];
  for (int i = 0; i < 3; i++) pass(i);
  long long maxdiff = 0;
  for (int i = 0; i < n; i++)
    if (men[i].t[3] - men[i].t[0] > maxdiff)
      maxdiff = men[i].t[3] - men[i].t[0];
  cout << maxdiff;
  return 0;
}
