#include <bits/stdc++.h>
using namespace std;
long long int base[101010];
int main() {
  int k1, k2, k3;
  multiset<long long int> tkn1, tkn2, tkn3;
  long long int t1, t2, t3;
  int n;
  memset(base, 0, sizeof(base));
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  cin >> n;
  tkn1 = multiset<long long int>(base, base + min(n, k1));
  tkn2 = multiset<long long int>(base, base + min(n, k2));
  tkn3 = multiset<long long int>(base, base + min(n, k3));
  long long int arrival, r = 0, t;
  for (int i = 0; i < n; i++) {
    cin >> arrival;
    t = arrival;
    t = max(*tkn1.begin() + t1, arrival + t1);
    tkn1.erase(tkn1.begin());
    tkn1.insert(t);
    t = max(t + t2, *tkn2.begin() + t2);
    tkn2.insert(t);
    tkn2.erase(tkn2.begin());
    t = max(t + t3, *tkn3.begin() + t3);
    tkn3.insert(t);
    tkn3.erase(tkn3.begin());
    r = max(t - arrival, r);
  }
  cout << r << endl;
  return 0;
}
