#include <bits/stdc++.h>
using namespace std;
long long c[100001], c1[100001], c2[100001], c3[100001], res[100001];
int main() {
  long long k1, k2, k3, t1, t2, t3, n;
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3 >> n;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < n; i++) {
    if (i / k1 == 0)
      c1[i] = c[i] + t1;
    else {
      if (c[i] >= c1[i - k1])
        c1[i] = c[i] + t1;
      else
        c1[i] = c1[i - k1] + t1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i / k2 == 0)
      c2[i] = c1[i] + t2;
    else {
      if (c1[i] >= c2[i - k2])
        c2[i] = c1[i] + t2;
      else
        c2[i] = c2[i - k2] + t2;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i / k3 == 0)
      c3[i] = c2[i] + t3;
    else {
      if (c2[i] >= c3[i - k3])
        c3[i] = c2[i] + t3;
      else
        c3[i] = c3[i - k3] + t3;
    }
  }
  long long max = -1;
  for (int i = 0; i < n; i++) {
    res[i] = c3[i] - c[i];
    if (res[i] > max) max = res[i];
  }
  cout << max << endl;
  return 0;
}
