#include <bits/stdc++.h>
using namespace std;
long long a[4][100001];
int main() {
  int k[3], t[3];
  int n;
  scanf("%d%d%d", &k[1], &k[2], &k[3]);
  scanf("%d%d%d", &t[1], &t[2], &t[3]);
  scanf("%d", &n);
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[0][i]);
    for (int j = 1; j < 4; j++) {
      if (i - k[j] < 0) {
        a[j][i] = a[j - 1][i] + t[j];
      } else {
        int x = i - k[j];
        long long v = 0;
        if (a[j][x] > a[j - 1][i]) v = a[j][x] - a[j - 1][i];
        a[j][i] = a[j - 1][i] + t[j] + v;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, a[3][i] - a[0][i]);
  cout << ans << endl;
  return 0;
}
