#include <bits/stdc++.h>
using namespace std;
const long long inf = 1LL << 61;
int k[4], t[4];
int n;
vector<int> c;
void solve(int ncase) {
  cin >> k[1] >> k[2] >> k[3] >> t[1] >> t[2] >> t[3] >> n;
  c.assign(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  sort(c.begin(), c.end());
  vector<queue<pair<long long, long long>>> q(
      4, queue<pair<long long, long long>>());
  for (int i = 0; i < n; i++) {
    q[0].push(pair<long long, long long>(c[i], i));
  }
  vector<vector<long long>> fin(4, vector<long long>(n));
  long long cur = 0;
  while (!(q[0].empty() && q[1].empty() && q[2].empty())) {
    vector<pair<long long, long long>> tope;
    for (int i = 0; i < 4; i++) {
      if (q[i].empty()) continue;
      tope.push_back(pair<long long, long long>(q[i].front().first, -i));
    }
    sort(tope.begin(), tope.end());
    for (int i = 0; i < tope.size(); i++) {
      int type = -tope[i].second;
      int idx = q[type].front().second;
      if (type + 1 == 4 || q[type + 1].size() < k[type + 1]) {
        cur = max(cur, tope[i].first);
        if (type + 1 == 4) {
          q[type].pop();
          break;
        }
        fin[type + 1][idx] = cur + t[type + 1];
        q[type].pop();
        q[type + 1].push(pair<long long, long long>(fin[type + 1][idx], idx));
        break;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, fin[3][i] - c[i]);
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  int T = 1;
  int ncase = 0;
  while (T--) {
    solve(++ncase);
  }
}
