#include <bits/stdc++.h>
using namespace std;
int n, k[3], tm[3];
int arr[100010];
priority_queue<long long> q[3];
int main() {
  while (cin >> k[0] >> k[1] >> k[2]) {
    for (int i = 0; i < 3; i++)
      while (!q[i].empty()) q[i].pop();
    cin >> tm[0] >> tm[1] >> tm[2] >> n;
    for (int i = 0; i < 3; i++) {
      k[i] = min(k[i], n);
      for (int j = 0; j < k[i]; j++) q[i].push(0);
    }
    long long mx = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &arr[i]);
      long long end = arr[i];
      for (int j = 0; j < 3; j++) {
        long long t = -q[j].top();
        q[j].pop();
        t = max(t, end);
        end = t + tm[j];
        q[j].push(-end);
      }
      mx = max(mx, end - arr[i]);
    }
    cout << mx << endl;
  }
  return 0;
}
