func_code_string: #include <bits/stdc++.h>   using namespace std;   long long K[5], T[5];   int main() {     queue<pair<long long, long long> > Q[5][2];     string ln;     int n;     getline(cin, ln);     istringstream(ln) >> K[1] >> K[2] >> K[3];     getline(cin, ln);     istringstream(ln) >> T[1] >> T[2] >> T[3];     getline(cin, ln);     istringstream(ln) >> n;     getline(cin, ln);     istringstream in(ln);     long long t0;     for (int i = 0; i < n; i++) {       in >> t0;       Q[1][0].push(pair<long long, long long>(t0, t0));     }     long long t = 0;     for (int i = 1; i <= 3; i++) {       while (Q[i][0].size()) {         t = Q[i][0].front().first;         t = max(t, Q[i][0].front().first);         t0 = Q[i][0].front().second;         Q[i][0].pop();         if (Q[i][1].size() < K[i]) {           Q[i][1].push(pair<long long, long long>(t + T[i], t0));         } else {           t = max(Q[i][1].front().first, t);           Q[i + 1][0].push(Q[i][1].front());           Q[i][1].pop();           Q[i][1].push(pair<long long, long long>(t + T[i], t0));         }       }       while (Q[i][1].size()) {         Q[i + 1][0].push(Q[i][1].front());         Q[i][1].pop();       }     }     long long res = 0;     while (Q[4][0].size()) {       res = max(res, Q[4][0].front().first - Q[4][0].front().second);       Q[4][0].pop();     }     cout << res << endl;     return 0;   }   