#include <bits/stdc++.h>
using namespace std;
int n;
int k[4];
int t[4];
long long c[100005], g[100005];
int main() {
  for (int i = 0, _n = (3); i < _n; i++) scanf("%d", &k[i]);
  for (int i = 0, _n = (3); i < _n; i++) scanf("%d", &t[i]);
  scanf("%d", &n);
  for (int i = 0, _n = (n); i < _n; i++) {
    cin >> g[i];
    c[i] = g[i];
  }
  for (int times = 0, _n = (3); times < _n; times++) {
    int f = 0, d = 0;
    for (int i = 0, _n = (n); i < _n; i++) {
      if (d < k[times])
        d++;
      else if (c[i] >= c[f])
        f++;
      else {
        c[i] = c[f];
        f++;
      }
      c[i] += t[times];
    }
  }
  long long mx = 0;
  for (int i = 0, _n = (n); i < _n; i++) mx = max(mx, c[i] - g[i]);
  cout << mx << endl;
  return 0;
}
