#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
long long q[3][maxn];
int c[maxn];
int t1, t2, t3, k1, k2, k3, n;
int main() {
  scanf("%d%d%d", &k1, &k2, &k3);
  scanf("%d%d%d", &t1, &t2, &t3);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &c[i]);
  sort(c, c + n);
  int l[3] = {1, 1, 1}, r[3] = {0, 0, 0};
  long long res = 0;
  for (int i = 0; i < n; i++) {
    long long tt;
    if (k1)
      tt = c[i], k1--;
    else
      tt = max((long long)c[i], q[0][l[0]++]);
    tt += t1;
    q[0][++r[0]] = tt;
    if (k2)
      k2--;
    else
      tt = max(tt, q[1][l[1]++]);
    tt += t2;
    q[1][++r[1]] = tt;
    if (k3)
      k3--;
    else
      tt = max(tt, q[2][l[2]++]);
    tt += t3;
    q[2][++r[2]] = tt;
    res = max(res, tt - c[i]);
  }
  cout << res << endl;
}
