#include <bits/stdc++.h>
using namespace std;
long long k[3];
long long t[3];
int n;
int c[100010];
long long to[3][100010];
int h[3];
int f[3];
int main() {
  cin >> k[0] >> k[1] >> k[2];
  cin >> t[0] >> t[1] >> t[2];
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &c[i]);
  }
  sort(c, c + n);
  long long res = 0;
  for (int i = 0; i < n; i++) {
    long long cur = c[i];
    for (int j = 0; j < 3; j++) {
      while (h[j] < f[j] && cur >= to[j][h[j]]) {
        h[j]++;
      }
      if (f[j] - h[j] >= k[j]) {
        cur += to[j][f[j] - k[j]] - cur;
      }
      cur += t[j];
      to[j][f[j]++] = cur;
    }
    res = max(res, cur - c[i]);
  }
  cout << res << endl;
  return 0;
}
