#include <bits/stdc++.h>
using namespace std;
long long k1, k2, k3, t1, t2, t3;
int n;
long long r1[100000], r2[100000], r3[100000];
struct compare1 {
  bool operator()(const int& f, const int& s) const {
    return ((r1[f] != r1[s]) ? r1[f] < r1[s] : f < s);
  }
};
struct compare2 {
  bool operator()(const int& f, const int& s) const {
    return ((r2[f] != r2[s]) ? r2[f] < r2[s] : f < s);
  }
};
struct compare3 {
  bool operator()(const int& f, const int& s) const {
    return ((r3[f] != r3[s]) ? r3[f] < r3[s] : f < s);
  }
};
set<int, compare1> U1;
set<int, compare2> U2;
set<int, compare3> U3;
int main() {
  int i, j, k, l;
  cin >> k1 >> k2 >> k3 >> t1 >> t2 >> t3;
  cin >> n;
  k1 = min((long long)n, k1);
  k2 = min((long long)n, k2);
  k3 = min((long long)n, k3);
  for (i = 0; i < k1; ++i) U1.insert(i);
  for (i = 0; i < k2; ++i) U2.insert(i);
  for (i = 0; i < k3; ++i) U3.insert(i);
  long long MT = 0;
  for (int Q = 0; Q < n; ++Q) {
    long long CT, old;
    cin >> CT;
    old = CT;
    int g1 = *U1.begin();
    U1.erase(g1);
    if (CT >= r1[g1]) {
      CT += t1;
      r1[g1] = CT;
    } else {
      CT = r1[g1] + t1;
      r1[g1] = CT;
    }
    U1.insert(g1);
    int g2 = *U2.begin();
    U2.erase(g2);
    if (CT >= r2[g2]) {
      CT += t2;
      r2[g2] = CT;
    } else {
      CT = r2[g2] + t2;
      r2[g2] = CT;
    }
    U2.insert(g2);
    int g3 = *U3.begin();
    U3.erase(g3);
    if (CT >= r3[g3]) {
      CT += t3;
      r3[g3] = CT;
    } else {
      CT = r3[g3] + t3;
      r3[g3] = CT;
    }
    U3.insert(g3);
    MT = max(MT, CT - old);
  }
  cout << MT << '\n';
  return 0;
}
