#include <bits/stdc++.h>
using namespace std;
const int N=100000+5;
int n;
int a[N]={0},b[N]={0};
int p[2*N]={0};
int lowbit(int x){
return x&(-x);
}
void add(int x,int y){
int t=x;
for (int i=x;i<=200000;i+=lowbit(i)){
p[i]=max(p[i],t);
}
return ;
}
int getsum(int x){
int t=0;
for (int i=x;i>0;i-=lowbit(i)){
t=max(t,p[i]);
}
return t;
}
int main(){
freopen ("EYOI_found.in","r",stdin);
freopen ("EYOI_found.out","w",stdout);
scanf("%d",&n);
for (int i=1;i<=n;i++){
scanf("%d%d",&a[i],&b[i]);
}
for (int i=1;i<=n;i++){
int t=getsum(a[i]+b[i]-1);
printf ("%d ",t);
if (a[i]>0) add(a[i],1);
}
return 0;
}