#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:255000000")
bool firstout = 1;
int n;
int A[101234];
multiset<long long> s[3];
int t[3];
int main() {
  int i, j, k;
  char c;
  long long a, d;
  for (; scanf("%"
               "d",
               &(n)) > 0;) {
    for (i = (0); i < (3); ++i) s[i].clear();
    n = min(n, 101234);
    for (i = (0); i < (n); ++i) s[0].insert(0);
    scanf(
        "%"
        "d",
        &(n));
    n = min(n, 101234);
    for (i = (0); i < (n); ++i) s[1].insert(0);
    scanf(
        "%"
        "d",
        &(n));
    n = min(n, 101234);
    for (i = (0); i < (n); ++i) s[2].insert(0);
    for (i = (0); i < (3); ++i)
      scanf(
          "%"
          "d",
          &(t[i]));
    long long res = 0;
    scanf(
        "%"
        "d",
        &(n));
    for (i = (0); i < (n); ++i) {
      scanf(
          "%"
          "I64d",
          &(a));
      long long aa = a;
      for (j = (0); j < (3); ++j) {
        d = *s[j].begin();
        s[j].erase(s[j].begin());
        d = max(d, a);
        a = d + t[j];
        s[j].insert(a);
      }
      res = max(res, a - aa);
    }
    printf(
        "%"
        "I64d",
        (res));
    printf("\n"), firstout = 1;
  }
  return 0;
}
