#include <bits/stdc++.h>
using namespace std;
int main() {
  long long k[4] = {0}, t[4] = {0}, n(0), s[100010][4] = {0}, b[4] = {0},
            ans(0);
  cin >> k[1] >> k[2] >> k[3];
  cin >> t[1] >> t[2] >> t[3];
  cin >> n;
  for (int i(1); i < (n + 1); i++) {
    cin >> s[i][0];
  }
  for (int i(1); i < (1 + n); i++) {
    for (int j(1); j < (4); j++) {
      if (i - b[j] == k[j]) {
        s[i][j] = max(s[b[j]][j] + t[j], s[i][j - 1] + t[j]);
        b[j]++;
      } else {
        s[i][j] = s[i][j - 1] + t[j];
      }
    }
    ans = ans < s[i][3] - s[i][0] ? s[i][3] - s[i][0] : ans;
  }
  cout << ans;
}
