#include <bits/stdc++.h>
using namespace std;
struct tout {
  template <class T>
  tout operator()(const T &x) {
    cout << x;
    return *this;
  }
} out;
struct tin {
  template <class T>
  tin operator()(T &x) {
    cin >> x;
    return *this;
  }
} in;
template <class T>
inline tout operator,(tout, const T &x) {
  cout << x;
  return tout();
}
template <class T>
inline tin operator,(tin, T &x) {
  cin >> x;
  return tin();
}
inline int ni() {
  int x;
  scanf("%d", &x);
  return x;
}
inline int nd() {
  double x;
  scanf("%lf", &x);
  return x;
}
int main() {
  vector<long long> k(3), t(3);
  for (int i = 0; i < (3); i++) in, k[i];
  for (int i = 0; i < (3); i++) in, t[i];
  int n;
  in, n;
  vector<long long> mas(n);
  for (int i = 0; i < (n); i++) in, mas[i];
  deque<long long> q[3];
  long long maxx = 0;
  for (int i = 0; i < (n); i++) {
    long long start = mas[i];
    long long time = mas[i];
    for (int j = 0; j < (3); j++) {
      if (q[j].size() < k[j]) {
        q[j].push_back(time + t[j]);
        time += t[j];
      } else {
        if (q[j].front() <= time) {
          q[j].pop_front();
          q[j].push_back(time + t[j]);
          time += t[j];
        } else {
          time = q[j].front();
          q[j].pop_front();
          q[j].push_back(time + t[j]);
          time += t[j];
        }
      }
    }
    maxx = max(maxx, time - start);
  }
  out, maxx;
  return 0;
}
