#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int n, c_0[MAXN];
long long c[MAXN];
int k[3], t[3];
void solve() {
  for (int win = 0; win < 3; ++win) {
    sort(&c[0], &c[n]);
    multiset<long long> t_f;
    for (int i = 0; i < min(k[win], n); ++i) t_f.insert(0);
    for (int i = 0; i < n; ++i) {
      multiset<long long>::iterator q = t_f.begin();
      long long z = max(*q, c[i]) + t[win];
      c[i] = z;
      t_f.erase(q);
      t_f.insert(z);
    }
  }
  long long answer = 0;
  for (int i = 0; i < n; ++i)
    if (answer < c[i] - c_0[i]) answer = c[i] - c_0[i];
  cout << answer << endl;
}
int main() {
  cin >> k[0] >> k[1] >> k[2];
  cin >> t[0] >> t[1] >> t[2];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> c_0[i];
    c[i] = c_0[i];
  }
  solve();
  return 0;
}
