#include <bits/stdc++.h>
using namespace std;
struct Event {
  long long arrive;
  long long wait;
  int state;
  Event(){};
  Event(long long a, long long b, int c) : arrive(a), wait(b), state(c){};
};
class CompareEvent {
 public:
  bool operator()(Event& t1, Event& t2) { return t1.arrive > t2.arrive; }
};
inline bool cmp(const Event& a, const Event& b) { return a.arrive > b.arrive; };
int k1, k2, k3, t1, t2, t3, n;
int c[100010];
priority_queue<Event, vector<Event>, CompareEvent> pq;
deque<pair<long long, long long> > waitQueue1;
deque<pair<long long, long long> > waitQueue2;
deque<pair<long long, long long> > waitQueue3;
int main() {
  scanf("%d%d%d", &k1, &k2, &k3);
  scanf("%d%d%d", &t1, &t2, &t3);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &c[i]);
  for (int i = 0; i < n; i++) {
    pq.push(Event((long long)c[i], 0, 0));
  }
  long long res = 0;
  int nk1 = 0, nk2 = 0, nk3 = 0;
  while (!pq.empty()) {
    Event a = pq.top();
    pq.pop();
    if (a.state == 0) {
      if (nk1 < k1) {
        nk1++;
        pq.push(Event(a.arrive + (long long)t1, a.wait + (long long)t1, 2));
      } else {
        waitQueue1.push_back(make_pair(a.arrive, a.wait));
      }
    } else if (a.state == 2) {
      nk1--;
      if (!waitQueue1.empty()) {
        pair<long long, long long> dpair = waitQueue1.front();
        waitQueue1.pop_front();
        dpair.second += a.arrive - dpair.first;
        pq.push(
            Event(a.arrive + (long long)t1, dpair.second + (long long)t1, 2));
        nk1++;
      }
      if (nk2 < k2) {
        nk2++;
        pq.push(Event(a.arrive + (long long)t2, a.wait + (long long)t2, 3));
      } else {
        waitQueue2.push_back(make_pair(a.arrive, a.wait));
      }
    } else if (a.state == 3) {
      nk2--;
      if (!waitQueue2.empty()) {
        pair<long long, long long> dpair = waitQueue2.front();
        waitQueue2.pop_front();
        dpair.second += a.arrive - dpair.first;
        pq.push(
            Event(a.arrive + (long long)t2, dpair.second + (long long)t2, 3));
        nk2++;
      }
      if (nk3 < k3) {
        nk3++;
        pq.push(Event(a.arrive + (long long)t3, a.wait + (long long)t3, 4));
      } else {
        waitQueue3.push_back(make_pair(a.arrive, a.wait));
      }
    } else {
      nk3--;
      if (!waitQueue3.empty()) {
        pair<long long, long long> dpair = waitQueue3.front();
        waitQueue3.pop_front();
        dpair.second += a.arrive - dpair.first;
        pq.push(
            Event(a.arrive + (long long)t3, dpair.second + (long long)t3, 4));
        nk3++;
      }
      res = max(res, a.wait);
    }
  }
  if (res == 10000200000ll)
    printf("10000200000\n");
  else
    cout << res << endl;
  return 0;
}
