#include <bits/stdc++.h>
using namespace std;
long long kol[100100], s[3], t[3], c[100100], d[100100];
int main(void) {
  for (int i = 0; i < (3); ++i) scanf("%I64d", &s[i]);
  for (int i = 0; i < (3); ++i) scanf("%I64d", &t[i]);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) {
    scanf("%I64d", &c[i]);
    d[i] = c[i];
  }
  sort(c, c + n);
  for (int i = 0; i < (3); ++i) {
    memset(kol, 0, sizeof kol);
    int cur = 0;
    for (int j = 0; j < (n); ++j) {
      if (cur == s[i]) cur = 0;
      kol[cur] = c[j] = max(kol[cur], c[j]) + t[i];
      ++cur;
    }
  }
  long long res = 0;
  for (int i = 0; i < (n); ++i) res = max(res, c[i] - d[i]);
  printf("%I64d\n", res);
  return 0;
}
