#include <cstdio>
#include <iostream>
#include <stack>
#include <algorithm>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100000
using namespace std;
int n;
int a[100];
int c[100];
int lowbit(int x) {
return x & (-x);
}
void change(int i, int x) {
//i为第几个要修改的元素
//x为修改后与修改前的差值
while (i <= MAX) {
c[i] += x;
i = i + lowbit(i);//最近父节点
}
}
int getsum(int i) {
int sum = 0;
while (i > 0) {
sum += c[i];
i = i - lowbit(i);//最近子节点
}
return sum;
}
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
int t;
cin >> t;
change(i, t);
}
return 0;
}