#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
struct SegmentTree {
  int l, r;
  long long val[N << 2];
  int id[N << 2];
  void init(int _l, int _r) {
    l = _l, r = _r;
    build(l, r, 1);
  }
  void build(int l, int r, int rt) {
    if (l == r) {
      val[rt] = 0;
      id[rt] = l;
      return;
    }
    int m = (l + r) >> 1;
    build(l, m, rt << 1);
    build(m + 1, r, rt << 1 | 1);
    pushUp(rt);
  }
  void pushUp(int rt) {
    if (val[rt << 1] < val[rt << 1 | 1]) {
      id[rt] = id[rt << 1];
      val[rt] = val[rt << 1];
    } else {
      id[rt] = id[rt << 1 | 1];
      val[rt] = val[rt << 1 | 1];
    }
  }
  void update(int p, long long v, int l, int r, int rt) {
    if (l == r) {
      val[rt] = v;
      return;
    }
    int m = (l + r) >> 1;
    if (p <= m)
      update(p, v, l, m, rt << 1);
    else
      update(p, v, m + 1, r, rt << 1 | 1);
    pushUp(rt);
  }
  int minID() { return id[1]; }
  long long minVal() { return val[1]; }
  void set(int p, long long v) { update(p, v, l, r, 1); }
} seg[3];
int k[3], t[3], n;
int main() {
  for (int i = 0; i < 3; i++) scanf("%d", &k[i]);
  for (int i = 0; i < 3; i++) scanf("%d", &t[i]);
  scanf("%d", &n);
  for (int i = 0; i < 3; i++) seg[i].init(1, min(k[i], n));
  long long cur, ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &cur);
    long long pre = cur;
    for (int kind = 0; kind < 3; kind++) {
      long long val = seg[kind].minVal();
      int id = seg[kind].minID();
      if (val > cur) {
        val += t[kind];
      } else {
        val = cur + t[kind];
      }
      seg[kind].set(id, val);
      cur = val;
    }
    ans = max(ans, cur - pre);
  }
  printf("%I64d\n", ans);
  return 0;
}
