#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const int maxn = 100000 + 5;
int c[3], n;
long long t[3], a[maxn];
vector<long long> g[3];
void add(long long &current, int k) {
  if (((int)g[k].size()) >= c[k])
    checkmax(current, g[k][((int)g[k].size()) - c[k]] + t[k]);
  g[k].push_back(current);
  current += t[k];
}
int main() {
  for (int i = 0; i < 3; i++) scanf("%d", &c[i]);
  for (int i = 0; i < 3; i++) {
    int tt;
    scanf("%d", &tt);
    t[i] = tt;
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int tt;
    scanf("%d", &tt);
    a[i] = tt;
  }
  long long R = 0;
  for (int i = 0; i < n; i++) {
    long long currenttime = a[i];
    for (int k = 0; k < 3; k++) add(currenttime, k);
    checkmax(R, currenttime - a[i]);
  }
  cout << R << endl;
  return 0;
}
