#include <iostream>
#include <fstream>
using namespace std;
ifstream f("triunghi3.in");
ofstream g("triunghi3.out");
unsigned long long val[1001],l1[1001],l2[1001];
int poz[1001],n;
void citire()
{
f>>n;
unsigned int i;
for(i=n;i>=1;i--)
f>>poz[i]>>val[i];
}
void sol()
{
unsigned long long v;
int p,i,j;
l1[poz[1]]=val[1];
for(i=2;i<=n;i++)
{
p=poz[i]; v=val[i];
l2[p]=v;
for(j=p+1;j<=i;j++) l2[j]=l1[j-1]-l2[j-1];
for(j=p-1;j>=1;j--) l2[j]=l1[j]-l2[j+1];
for(j=1;j<=i;j++) l1[j]=l2[j];
}
}
void afis() {
int i;
for(i=1;i<=n;i++)
g<<l1[i]<<" ";
g<<endl;
}
int main()
{
citire();
sol();
afis();
f.close();
g.close();
return 0;
}