#include <iostream>
#include <vector>
#include <fstream>
#include <ctime>
#include <random>
#include <algorithm>
#include <cassert>
#include <queue>
#include <cstring>
#include <unordered_map>
using namespace std;

random_device rand_dev;
mt19937_64 generator(rand_dev());
main() {
    srand(time(0));
    for(int i = 81; i <= 90; i++) {
        int n = 50000+generator()%50000;
        vector<long long> p;
        for(int i = 1; i <= n; i++) p.push_back((generator()%(long long)1e12)*(generator()%2==0?1:-1));
        ofstream in(string("ezici.") + (i<10?"0":"") + (i<100?"0":"") + to_string(i) + ".in");
        ofstream out(string("ezici.") + (i<10?"0":"") + (i<100?"0":"") + to_string(i) + ".out");
        in << -9 << endl;
        in << n << endl;
        long long mn=0,ans=0,sum=0;
        for(auto x : p) {
            in << x << " ";
            sum+=x;
            ans=max(ans, sum-mn);
            mn=min(mn, sum);
        }
        in << endl;
        out << ans << endl;
    }
}