#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
int n;
int timeIn[1 << 17];
int k1, k2, k3;
int t1, t2, t3;
inline void init() {
  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", &timeIn[i]);
  }
}
inline pair<pair<long long, long long>, long long> make(long long t,
                                                        long long type,
                                                        long long id) {
  return pair<pair<long long, long long>, long long>(
      pair<long long, long long>(t, type), id);
}
priority_queue<pair<pair<long long, long long>, long long>,
               vector<pair<pair<long long, long long>, long long> >,
               greater<pair<pair<long long, long long>, long long> > >
    q;
int stage[1 << 17];
long long res;
inline void free(long long &x, long long &id) {
  if (x == 1) ++k1;
  if (x == 2) ++k2;
  if (x == 3) ++k3;
  ++stage[(int)id];
}
int main() {
  init();
  res = 0;
  int cur1 = 0;
  int cur2 = 0;
  int cur3 = 0;
  for (int i = 0; i < n; ++i) {
    q.push(make((long long)timeIn[i], 0, i));
    stage[i] = 0;
  }
  while (!q.empty()) {
    pair<pair<long long, long long>, long long> onTop = q.top();
    long long T = onTop.first.first;
    while (!q.empty() && q.top().first.first == T) {
      pair<pair<long long, long long>, long long> cur = q.top();
      q.pop();
      free(cur.first.second, cur.second);
      if (stage[cur.second] == 4) {
        res = max(res, T - (long long)timeIn[cur.second]);
      }
    }
    while (cur1 < n && stage[cur1] == 1) {
      if (!k1) break;
      --k1;
      q.push(make(T + (long long)t1, 1, cur1));
      ++cur1;
    }
    while (cur2 < n && stage[cur2] == 2) {
      if (!k2) break;
      --k2;
      q.push(make(T + (long long)t2, 2, cur2));
      ++cur2;
    }
    while (cur3 < n && stage[cur3] == 3) {
      if (!k3) break;
      --k3;
      q.push(make(T + (long long)t3, 3, cur3));
      ++cur3;
    }
  }
  cout << res << endl;
  return 0;
}
