#include <bits/stdc++.h>
using namespace std;
long long int k1, k2, k3;
long long int t1, t2, t3;
long long int a1, a2, a3;
long long int n;
struct state {
  long long int time;
  int no;
  long long int s;
};
bool operator<(const state &a, const state &b) { return a.time > b.time; }
deque<state> q1, q2, q3;
vector<long long int> c;
int main() {
  long long int res = 0;
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  c = vector<long long int>(n);
  for (long long int i = 0; i < n; i++) cin >> c[i];
  priority_queue<state> que;
  state t;
  for (long long int i = 0; i < n; i++) {
    t.no = 0;
    t.time = c[i];
    t.s = c[i];
    que.push(t);
  }
  while (!que.empty()) {
    t = que.top();
    que.pop();
    if (t.no == 1) {
      a1--;
      q2.push_back(t);
    } else if (t.no == 0) {
      q1.push_back(t);
    } else if (t.no == 2) {
      a2--;
      q3.push_back(t);
    } else if (t.no == 3) {
      a3--;
      res = max<long long int>(res, t.time - t.s);
    }
    int s;
    do {
      s = 0;
      if (q1.size() && a1 < k1) {
        state tmp = q1.front();
        q1.pop_front();
        tmp.time = t.time + t1;
        tmp.no = 1;
        que.push(tmp);
        a1++;
        s++;
      }
      if (q2.size() && a2 < k2) {
        state tmp = q2.front();
        q2.pop_front();
        tmp.time = t.time + t2;
        tmp.no = 2;
        que.push(tmp);
        a2++;
        s++;
      }
      if (q3.size() && a3 < k3) {
        state tmp = q3.front();
        q3.pop_front();
        tmp.time = t.time + t3;
        tmp.no = 3;
        que.push(tmp);
        a3++;
        s++;
      }
    } while (s != 0);
  }
  cout << res << endl;
  return 0;
}
