func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long N = 1e5;   long long aa[N + 2], bb[N + 2];   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     long long k1, k2, k3;     cin >> k1 >> k2 >> k3;     long long t1, t2, t3;     cin >> t1 >> t2 >> t3;     long long n;     cin >> n;     for (long long i = 1; i <= n; i++) cin >> aa[i], bb[i] = aa[i];     multiset<long long> st;     vector<long long> v;     for (long long i = 1; i <= n; i++) {       while (true) {         if (st.size() == 0) break;         long long x = *st.begin();         if (x < aa[i])           st.erase(st.find(x));         else           break;       }       if (st.size() < k1) {         st.insert(aa[i] + t1 - 1);         v.push_back(aa[i] + t1);       } else {         long long x = *st.begin();         st.erase(st.find(x));         st.insert(x + t1);         v.push_back(x + t1 + 1);       }     }     for (long long i = 1; i <= n; i++) aa[i] = v[i - 1];     v.clear();     st.clear();     for (long long i = 1; i <= n; i++) {       while (true) {         if (st.size() == 0) break;         long long x = *st.begin();         if (x < aa[i])           st.erase(st.find(x));         else           break;       }       if (st.size() < k2) {         st.insert(aa[i] + t2 - 1);         v.push_back(aa[i] + t2);       } else {         long long x = *st.begin();         st.erase(st.find(x));         st.insert(x + t2);         v.push_back(x + t2 + 1);       }     }     for (long long i = 1; i <= n; i++) aa[i] = v[i - 1];     v.clear();     st.clear();     for (long long i = 1; i <= n; i++) {       while (true) {         if (st.size() == 0) break;         long long x = *st.begin();         if (x < aa[i])           st.erase(st.find(x));         else           break;       }       if (st.size() < k3) {         st.insert(aa[i] + t3 - 1);         v.push_back(aa[i] + t3);       } else {         long long x = *st.begin();         st.erase(st.find(x));         st.insert(x + t3);         v.push_back(x + t3 + 1);       }     }     for (long long i = 1; i <= n; i++) aa[i] = v[i - 1];     v.clear();     st.clear();     long long mx = 0;     for (long long i = 1; i <= n; i++) mx = max(mx, aa[n] - bb[n]);     cout << mx << endl;     return 0;   }   