#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
long long k1, k2, k3;
long long t1, t2, t3;
int n;
int a[N];
int id[N];
long long dp[N];
long long tim[N];
bool cmp(const int x, const int y) { return dp[x] < dp[y]; }
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 0, _n = n; i < _n; ++i) scanf("%d", &a[i]);
  for (int i = 0, _n = n; i < _n; ++i) id[i] = i;
  int i = 0;
  for (i = 0; i < n; ++i) tim[i] = 0, dp[i] = a[i];
  i = 0;
  sort(id, id + n, cmp);
  for (int j = 0; j < n; ++j, ++i) {
    if (i >= k1) i -= k1;
    if (tim[i] > dp[id[j]]) {
      dp[id[j]] = tim[i] + t1;
      tim[i] = dp[id[j]];
    } else {
      dp[id[j]] = dp[id[j]] + t1;
      tim[i] = dp[id[j]];
    }
  }
  for (i = 0; i < n; ++i) tim[i] = 0, id[i] = i;
  i = 0;
  sort(id, id + n, cmp);
  for (int j = 0; j < n; ++j, ++i) {
    if (i >= k2) i -= k2;
    if (tim[i] > dp[id[j]]) {
      dp[id[j]] = tim[i] + t2;
      tim[i] = dp[id[j]];
    } else {
      dp[id[j]] = dp[id[j]] + t2;
      tim[i] = dp[id[j]];
    }
  }
  for (i = 0; i < n; ++i) tim[i] = 0, id[i] = i;
  i = 0;
  sort(id, id + n, cmp);
  for (int j = 0; j < n; ++j, ++i) {
    if (i >= k3) i -= k3;
    if (tim[i] > dp[id[j]]) {
      dp[id[j]] = tim[i] + t3;
      tim[i] = dp[id[j]];
    } else {
      dp[id[j]] = dp[id[j]] + t3;
      tim[i] = dp[id[j]];
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) ans = max(ans, dp[i] - a[i]);
  cout << ans << endl;
}
