#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const long double eps = 1e-07;
long long k1, k2, k3;
long long t1, t2, t3;
long long tek1, tek2, tek3;
int n;
long long a[150000];
long long ans = 0;
set<pair<long long, pair<int, int>>> a1;
set<pair<long long, int>> sv1, sv2, sv3;
int main() {
  cin >> k1 >> k2 >> k3;
  cin >> t1 >> t2 >> t3;
  tek1 = k1;
  tek2 = k2;
  tek3 = k3;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    a1.insert(make_pair(a[i], make_pair(0, i)));
  }
  while (!a1.empty() || !sv1.empty() || !sv2.empty() || !sv3.empty()) {
    long long tektime = (*a1.begin()).first;
    while (!a1.empty() && (*a1.begin()).first == tektime) {
      pair<int, int> t = (*a1.begin()).second;
      a1.erase(a1.begin());
      if (t.first == 0) {
        sv1.insert(make_pair(0, t.second));
      }
      if (t.first == 1) {
        ++tek1;
        sv2.insert(make_pair(a[t.second], t.second));
      }
      if (t.first == 2) {
        ++tek2;
        sv3.insert(make_pair(a[t.second], t.second));
      }
      if (t.first == 3) {
        ++tek3;
        if (ans < tektime - a[t.second]) ans = tektime - a[t.second];
      }
    }
    while (tek1 && !sv1.empty()) {
      --tek1;
      int t = (*sv1.begin()).second;
      a1.insert(make_pair(tektime + t1, make_pair(1, t)));
      sv1.erase(*sv1.begin());
    }
    while (tek2 && !sv2.empty()) {
      --tek2;
      int t = (*sv2.begin()).second;
      a1.insert(make_pair(tektime + t2, make_pair(2, t)));
      sv2.erase(*sv2.begin());
    }
    while (tek3 && !sv3.empty()) {
      --tek3;
      int t = (*sv3.begin()).second;
      a1.insert(make_pair(tektime + t3, make_pair(3, t)));
      sv3.erase(*sv3.begin());
    }
  }
  cout << ans << endl;
  return 0;
}
