#include <bits/stdc++.h>
int n;
int k1, k2, k3, t1, t2, t3;
long long st[100010], ed[100010];
std::pair<long long, int> peo[100010];
void fun(int k, int t) {
  std::sort(peo + 1, peo + n + 1);
  for (int i = 1; i <= k; ++i) {
    if (i > n) break;
    for (int j = i; j <= n; j += k) {
      if (j - k <= 0)
        peo[j].first += t;
      else {
        long long tim = std::max(peo[j - k].first, peo[j].first);
        peo[j].first = tim + t;
      }
    }
  }
}
int main(void) {
  scanf("%d%d%d%d%d%d", &k1, &k2, &k3, &t1, &t2, &t3);
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &st[i]);
  for (int i = 1; i <= n; ++i) peo[i].first = st[i], peo[i].second = i;
  fun(k1, t1);
  fun(k2, t2);
  fun(k3, t3);
  long long max = 0;
  for (int i = 1; i <= n; ++i)
    max = std::max(max, peo[i].first - st[peo[i].second]);
  printf("%I64d\n", max);
  return 0;
}
