#include <bits/stdc++.h>
using namespace std;
struct Elem {
  int type;
  int idx;
  long long time;
  Elem(int a = 0, int b = 0, long long c = 0) {
    type = a;
    idx = b;
    time = c;
  }
  bool operator<(const Elem& other) const {
    if (time != other.time) return time < other.time;
    if (type != other.type) return type < other.type;
    return idx < other.idx;
  }
};
int n;
int k1, k2, k3;
long long c[100005];
long long t1, t2, t3;
set<Elem> s;
int f[4];
int l[4];
int q[4][100005];
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  s.clear();
  for (int i = 0; i < n; ++i) {
    cin >> c[i];
    s.insert(Elem(0, i, c[i]));
  }
  long long res = 0;
  f[0] = f[1] = f[2] = f[3] = 0;
  l[0] = l[1] = l[2] = l[3] = 0;
  while (!s.empty()) {
    Elem top = *(s.begin());
    s.erase(s.begin());
    if (top.type == 0) {
      if (k1 > 0) {
        s.insert(Elem(1, top.idx, top.time + t1));
        --k1;
      } else
        q[1][l[1]++] = top.idx;
    } else if (top.type == 1) {
      if (k2 > 0) {
        s.insert(Elem(2, top.idx, top.time + t2));
        --k2;
      } else
        q[2][l[2]++] = top.idx;
      ++k1;
      if (l[1] > f[1]) {
        s.insert(Elem(1, q[1][f[1]], top.time + t1));
        f[1]++;
        --k1;
      }
    } else if (top.type == 2) {
      if (k3 > 0) {
        s.insert(Elem(3, top.idx, top.time + t3));
        --k3;
      } else
        q[3][l[3]++] = top.idx;
      ++k2;
      if (l[2] > f[2]) {
        s.insert(Elem(2, q[2][f[2]], top.time + t2));
        f[2]++;
        --k2;
      }
    } else if (top.type == 3) {
      res = max(res, top.time - c[top.idx]);
      ++k3;
      if (l[3] > f[3]) {
        s.insert(Elem(3, q[3][f[3]], top.time + t3));
        f[3]++;
        --k3;
      }
    }
  }
  cout << res << endl;
  return 0;
}
