#include <bits/stdc++.h>
using namespace std;
queue<long long> windows[3];
int lim[3], wait[3];
int main() {
  for (int i = 0; i < 3; ++i) {
    cin >> lim[i];
  }
  for (int i = 0; i < 3; ++i) {
    cin >> wait[i];
  }
  int n;
  cin >> n;
  long long maxwait = 0, st, cur;
  for (int i = 0; i < n; ++i) {
    cin >> st;
    cur = st;
    for (int j = 0; j < 3; ++j) {
      if (windows[j].size() < lim[j]) {
        cur += wait[j];
        windows[j].push(cur);
        continue;
      }
      cur = max(cur, windows[j].front()) + wait[j];
      windows[j].push(cur);
      windows[j].pop();
    }
    maxwait = max(maxwait, cur - st);
  }
  cout << maxwait;
}
