#include <bits/stdc++.h>
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-9;
using namespace std;
const int MAXN = 100010;
int k[3], t[3], n, d[MAXN];
long long re, f[MAXN], a[3][MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j;
  for (i = 0; i <= 2; i++) cin >> k[i];
  for (i = 0; i <= 2; i++) cin >> t[i];
  cin >> n;
  for (i = 0; i <= 2; i++) k[i] = min(k[i], n);
  for (i = 1; i <= n; i++) cin >> d[i], f[i] = d[i];
  for (j = 0; j <= 2; j++) {
    int cur = 0;
    for (i = 1; i <= n; i++) {
      f[i] = max(f[i], a[j][cur]) + t[j];
      a[j][cur++] = f[i];
      if (cur == k[j]) cur = 0;
    }
  }
  cout << f[n] - d[n] << endl;
  return 0;
}
