#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  cin.sync_with_stdio(false);
  cout << setprecision(16);
  long long k[3], t[3], i, j, current = 1, sum = 0, N, result = 0;
  queue<long long> q[3];
  for (i = 0; i < (int)(3); i++) cin >> k[i];
  for (i = 0; i < (int)(3); i++) cin >> t[i];
  for (i = 0; i < (int)(3); i++) sum += t[i];
  cin >> N;
  for (i = 0; i < (int)(N); i++) {
    long long now, wait = 0;
    cin >> now;
    current = 1;
    for (j = 0; j < (int)(3); j++) {
      while (q[j].size() >= k[j]) {
        current = q[j].front() + t[j];
        q[j].pop();
      }
      if (current > now) {
        wait += current - now;
        now = current;
      }
      q[j].push(now);
      now += t[j];
    }
    result = max(result, wait);
  }
  cout << result + sum;
  cout.flush();
}
