#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 110000;
int k[3], t[3];
long long c[4][N_MAX];
int main() {
  for (int i = 0; i < 3; ++i) cin >> k[i];
  for (int i = 0; i < 3; ++i) cin >> t[i];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    c[0][i] = tmp;
  }
  for (int z = 0; z < 3; ++z) {
    deque<long long> q(min(n, k[z]), -1);
    for (int i = 0; i < n; ++i) {
      long long tmin = q.front();
      q.pop_front();
      long long tend = max(tmin, c[z][i]) + t[z];
      q.push_back(tend);
      c[z + 1][i] = tend;
    }
  }
  long long ans = -1;
  for (int i = 0; i < n; ++i) ans = max(ans, c[3][i] - c[0][i]);
  cout << ans << '\n';
  return 0;
}
