#include <bits/stdc++.h>
using namespace std;
int N, M, K, SN, SM, SK, Q;
priority_queue<long long int, vector<long long int>, greater<long long int> >
    heap;
struct node {
  long long int x, y;
} ar[100007];
bool operator<(const node &a, const node &b) { return a.x < b.x; }
void oku() {
  scanf("%d %d %d", &N, &M, &K);
  scanf("%d %d %d", &SN, &SM, &SK);
  scanf("%d", &Q);
  for (int i = 1; i <= Q; i++) {
    cin >> ar[i].y;
    ar[i].x = ar[i].y;
  }
  sort(ar + 1, ar + Q + 1);
}
void islem() {
  for (int i = 1; i <= Q; i++) {
    while (!heap.empty() && heap.top() <= ar[i].x) {
      N++;
      heap.pop();
    }
    if (N) {
      heap.push(ar[i].x + SN);
      ar[i].x += SN;
      N--;
    } else {
      ar[i].x = heap.top();
      heap.pop();
      heap.push(ar[i].x + SN);
      ar[i].x += SN;
    }
  }
  sort(ar + 1, ar + Q + 1);
  while (!heap.empty()) heap.pop();
  for (int i = 1; i <= Q; i++) {
    while (!heap.empty() && heap.top() <= ar[i].x) {
      M++;
      heap.pop();
    }
    if (M) {
      heap.push(ar[i].x + SM);
      ar[i].x += SM;
      M--;
    } else {
      ar[i].x = heap.top();
      heap.pop();
      heap.push(ar[i].x + SM);
      ar[i].x += SM;
    }
  }
  sort(ar + 1, ar + Q + 1);
  while (!heap.empty()) heap.pop();
  for (int i = 1; i <= Q; i++) {
    while (!heap.empty() && heap.top() <= ar[i].x) {
      K++;
      heap.pop();
    }
    if (K) {
      heap.push(ar[i].x + SK);
      ar[i].x += SK;
      K--;
    } else {
      ar[i].x = heap.top();
      heap.pop();
      heap.push(ar[i].x + SK);
      ar[i].x += SK;
    }
  }
  long long int maxi = 0;
  for (int i = 1; i <= Q; i++)
    if (ar[i].x - ar[i].y > maxi) maxi = ar[i].x - ar[i].y;
  cout << maxi << '\n';
}
int main() {
  int a;
  oku();
  islem();
  return 0;
}
