#include <bits/stdc++.h>
using namespace std;
int main() {
  int k[3], t[3], n;
  long long ct[100010], ft[100010];
  while (scanf("%d%d%d", &k[0], &k[1], &k[2]) != EOF) {
    for (int i = 0; i < 3; ++i) scanf("%d", &t[i]);
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
      scanf("%I64d", &ct[i]);
      ft[i] = ct[i];
    }
    for (int j = 0; j < 3; ++j) {
      priority_queue<long long> q;
      for (int i = 0; i < min(n, k[j]); ++i) q.push(0);
      for (int i = 0; i < n; ++i) {
        long long tt = -q.top();
        q.pop();
        ft[i] = max(tt, ft[i]) + t[j];
        q.push(-ft[i]);
      }
    }
    long long ans = -1;
    for (int i = 0; i < n; ++i) ans = max(ans, ft[i] - ct[i]);
    printf("%I64d\n", ans);
  }
  return 0;
}
