#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T checkmax(T a, T b) {
  if (a > b) return a;
  return b;
}
int main() {
  int n, k[5], t[5];
  long long ans, c[100005], w[100005];
  cin >> k[0] >> k[1] >> k[2] >> t[0] >> t[1] >> t[2];
  cin >> n;
  for (int i = (0), _b = (n); i < _b; i++) {
    scanf("%d", &c[i]);
    w[i] = 0;
  }
  ans = 0;
  for (int i = (0), _b = (3); i < _b; i++) {
    for (int j = (0), _b = (n); j < _b; j++) {
      if (j - k[i] < 0) {
        w[j] += t[i];
        c[j] += t[i];
      } else {
        w[j] += t[i] + checkmax(c[j - k[i]] - c[j], 0ll);
        c[j] = checkmax(c[j], c[j - k[i]]);
        c[j] += t[i];
      }
      ans = (ans < w[j]) ? w[j] : ans;
    }
  }
  {
    printf("%I64d", ans);
    return 0;
  };
}
