#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    for(int i=0; i<N; i++){
        int a = 2*i%N;
        int b = (2*i+1)%N;
        cout << a+1 << " " << b+1 << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while ('0'>ch||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
typedef long long ll;
const int maxn=(2e5)+10;
int n;
ll a[maxn],ans,mx;

int main() {
//	freopen("1.txt","r",stdin);
	read(n);
	for (int i=1;i<=n;i++) {
		read(a[i]); mx=max(mx,a[i]);
		a[i]+=a[i-1];
		ans+=a[i];
		printf("%lld\n",ans+mx*i);
	}
	return 0;
}