#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 1000 + 100;
long long t[3], k[3];
long long last[MAXN], now[MAXN];
int N;
int main() {
  for (__typeof(3) i = (0); i < (3); ++i) cin >> k[i];
  for (__typeof(3) i = (0); i < (3); ++i) cin >> t[i];
  cin >> N;
  for (__typeof(N) i = (0); i < (N); ++i) {
    cin >> now[i];
    last[i] = now[i];
  }
  for (__typeof(3) i = (0); i < (3); ++i) {
    if (k[i] >= N) {
      for (__typeof(N) j = (0); j < (N); ++j) last[j] += t[i];
    } else {
      for (__typeof(N) j = (0); j < (N); ++j) {
        if (k[i] > j)
          last[j] += t[i];
        else {
          last[j] = max(last[j], last[j - k[i]]) + t[i];
        }
      }
    }
  }
  long long ans = 0;
  for (__typeof(N) i = (0); i < (N); ++i) {
    ans = max(ans, last[i] - now[i]);
  }
  cout << ans << endl;
  return 0;
}
