#include <bits/stdc++.h>
using namespace std;
const int MAX = 100010;
int cnt[3];
int cost[3];
int reach[MAX];
long long p[MAX];
int N;
void solve(int n, int c) {
  priority_queue<long long> pQ;
  for (int i = 0; i < n; i++) pQ.push(0);
  for (int i = 0; i < N; i++) {
    long long t = -pQ.top();
    pQ.pop();
    t = max(t, p[i]);
    p[i] = t + c;
    pQ.push(-p[i]);
  }
}
int main() {
  {
    for (int i = 0; i < 3; i++) cin >> cnt[i];
    for (int i = 0; i < 3; i++) cin >> cost[i];
    cin >> N;
    for (int i = 0; i < N; i++) {
      scanf("%d", reach + i);
      p[i] = reach[i];
    }
    sort(p, p + N);
    sort(reach, reach + N);
    for (int i = 0; i < 3; i++) {
      solve(min(cnt[i], N), cost[i]);
    }
    long long ans = -1;
    for (int i = 0; i < N; i++) {
      ans = max(ans, p[i] - reach[i]);
    }
    cout << ans << endl;
  }
  return 0;
}
