#include <bits/stdc++.h>
using namespace std;
long long room[3];
long long t[3];
int N;
long long c[4][100000];
int main() {
  for (int n = 0; n < (3); n++) scanf("%I64d", &room[n]);
  for (int n = 0; n < (3); n++) scanf("%I64d", &t[n]);
  scanf("%d", &N);
  for (int n = 0; n < (N); n++) {
    scanf("%I64d", &c[0][n]);
  }
  for (int k = 0; k < 3; k++) {
    for (int n = 0; n < N; n++) {
      if (n < room[k]) {
        c[k + 1][n] = c[k][n] + t[k];
      } else {
        c[k + 1][n] = max(c[k + 1][n - room[k]] + t[k], c[k][n] + t[k]);
      }
    }
  }
  long long res = 0;
  for (int n = 0; n < N; n++) {
    res = max(res, c[3][n] - c[0][n]);
    ;
  }
  printf("%I64d\n", res);
}
