#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename C>
ostream& operator<<(ostream& os, const vector<C>& v) {
  for (__typeof((v).begin()) __it = (v).begin(); __it != (v).end(); __it++)
    os << *(__it) << ' ';
  return os;
}
const int inf = 0x3f3f3f3f;
const long long inf64 = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-5;
const int maxn = 100500;
long long time_for_free[3][maxn];
int main() {
  int k[3];
  for (int i = 0; i < 3; i++) cin >> k[i];
  int t[3];
  for (int i = 0; i < 3; i++) cin >> t[i];
  int n;
  cin >> n;
  int cur[3] = {0};
  long long res = -inf64;
  for (int i = 0; i < n; i++) {
    long long c;
    cin >> c;
    long long start = c;
    for (int j = 0; j < 3; j++) {
      c = max(c, time_for_free[j][cur[j]]) + t[j];
      time_for_free[j][cur[j]] = c;
      cur[j]++;
      cur[j] %= k[j];
    }
    long long timeforthis = c - start;
    res = max(res, timeforthis);
  }
  cout << res << endl;
  return 0;
}
