#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
struct event {
  int id;
  string com;
  long long time;
  inline bool operator<(const event &a1) const {
    if (time != a1.time) return time < a1.time;
    if (id != a1.id) return id < a1.id;
    return com < a1.com;
  }
  event() {}
  event(long long t, int id, string c) {
    com = c;
    time = t;
    this->id = id;
  }
};
int k1, k2, k3;
int t1, t2, t3;
int n;
int c[maxn];
long long f[maxn];
set<event> h, q1, q2, q3;
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    h.insert(event(c[i], i, "e1"));
  }
  long long t = 0;
  int c1 = 0, c2 = 0, c3 = 0;
  while (!h.empty()) {
    event x = *h.begin();
    t = x.time;
    h.erase(h.begin());
    if (x.com == "e1") {
      if (c1 < k1) {
        h.insert(event(t + t1, x.id, "l1"));
        c1++;
      } else
        q1.insert(x);
    } else if (x.com == "l1") {
      if (!q1.empty()) {
        event tmp = *q1.begin();
        h.insert(event(t + t1, tmp.id, "l1"));
        q1.erase(q1.begin());
      } else
        c1--;
      if (c2 < k2) {
        h.insert(event(t + t2, x.id, "l2"));
        c2++;
      } else
        q2.insert(x);
    } else if (x.com == "l2") {
      if (!q2.empty()) {
        event tmp = *q2.begin();
        h.insert(event(t + t2, tmp.id, "l2"));
        q2.erase(q2.begin());
      } else
        c2--;
      if (c3 < k3) {
        h.insert(event(t + t3, x.id, "l3"));
        c3++;
      } else
        q3.insert(x);
    } else if (x.com == "l3") {
      if (!q3.empty()) {
        event tmp = *q3.begin();
        h.insert(event(t + t3, tmp.id, "l3"));
        q3.erase(q3.begin());
      } else
        c3--;
      f[x.id] = t;
    }
  }
  long long max = -1;
  for (int i = 0; i < n; i++)
    if (max == -1 || f[i] - c[i] > max) max = f[i] - c[i];
  cout << max << endl;
  return 0;
}
