#include <bits/stdc++.h>
using namespace std;
long long k[3], t[3], n, res = 0, c[100001], cc[100001];
void perform(long long kind, long long time) {
  if (kind >= n) {
    for (int i = 0; i < n; ++i) c[i] += time;
  } else {
    for (long long i = 0; i < n; ++i) {
      if (i < kind)
        c[i] += time;
      else {
        if (c[i] <= c[i - kind])
          c[i] = c[i - kind] + time;
        else
          c[i] += time;
      }
    }
  }
}
int main() {
  while (cin >> k[0] >> k[1] >> k[2] >> t[0] >> t[1] >> t[2] >> n) {
    for (int i = 0; i < n; ++i) cin >> c[i];
    for (int i = 0; i < n; ++i) cc[i] = c[i];
    for (int i = 0; i < 3; ++i) perform(k[i], t[i]);
    for (int i = 0; i < n; ++i) res = max(res, c[i] - cc[i]);
    cout << res << endl;
  }
  return 0;
}
