#include <bits/stdc++.h>
using namespace std;
int main() {
  int k[3], t[3], n;
  vector<int> c;
  queue<long long> window[3];
  queue<long long> q[4];
  cin >> k[0] >> k[1] >> k[2];
  cin >> t[0] >> t[1] >> t[2];
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    c.push_back(tmp);
  }
  for (int i = 0; i < n; i++) {
    q[0].push(c[i]);
  }
  sort(c.begin(), c.end());
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < min(k[i], n); j++) {
      window[i].push(0);
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) {
      long long earliest = max(window[i].front(), q[i].front());
      window[i].pop();
      q[i].pop();
      window[i].push(earliest + t[i]);
      q[i + 1].push(earliest + t[i]);
    }
  }
  long long result = 0;
  for (int i = 0; i < n; i++) {
    result = max(result, q[3].front() - c[i]);
    q[3].pop();
  }
  cout << result << endl;
  return 0;
}
