#include <bits/stdc++.h>
using namespace std;
long long c[100100];
long long a[100100];
long long b[100100];
long long d[100100];
int main() {
  int k1, k2, k3;
  cin >> k1 >> k2 >> k3;
  int t1, t2, t3;
  cin >> t1 >> t2 >> t3;
  int n;
  cin >> n;
  for (int i = (0); i < (n); ++i) scanf("%I64d", &c[i]);
  sort(c, c + n);
  for (int i = (0); i < (n); ++i) {
    if (i < k1)
      a[i] = c[i] + t1;
    else
      a[i] = ((c[i] < a[i - k1]) ? (a[i - k1]) : (c[i])) + t1;
  }
  for (int i = (0); i < (n); ++i) {
    if (i < k2)
      b[i] = a[i] + t2;
    else
      b[i] = ((a[i] < b[i - k2]) ? (b[i - k2]) : (a[i])) + t2;
  }
  for (int i = (0); i < (n); ++i) {
    if (i < k3)
      d[i] = b[i] + t3;
    else
      d[i] = ((b[i] < d[i - k3]) ? (d[i - k3]) : (b[i])) + t3;
  }
  long long res = d[0] - c[0];
  for (int i = (1); i < (n); ++i)
    res = ((res < d[i] - c[i]) ? (d[i] - c[i]) : (res));
  cout << res << endl;
  return 0;
}
