#include <bits/stdc++.h>
using namespace std;
long long cc[100010];
long long c[2][100010];
void f(int k, int t, int n, const long long *p, long long *q) {
  for (int i = 0; i < n; i++) {
    if (i < k) {
      q[i] = p[i] + t;
    } else {
      q[i] = max(p[i] + t, q[i - k] + t);
    }
  }
}
void print(int n, const long long *p) {
  for (int i = 0; i < n; i++) printf("%lld ", p[i]);
  printf("\n");
}
int main() {
  int k1, k2, k3;
  scanf("%d %d %d", &k1, &k2, &k3);
  int t1, t2, t3;
  scanf("%d %d %d", &t1, &t2, &t3);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &c[0][i]);
  for (int i = 0; i < n; i++) cc[i] = c[0][i];
  f(k1, t1, n, c[0], c[1]);
  f(k2, t2, n, c[1], c[0]);
  f(k3, t3, n, c[0], c[1]);
  long long ans = 0;
  int ind = -1;
  for (int i = 0; i < n; i++) {
    if (ans < c[1][i] - cc[i]) {
      ans = c[1][i] - cc[i];
      ind = i;
    }
  }
  cout << ans << endl;
}
