program gls;
var
n,b,i,j,w:longint;tail:int64;
ss:array[1..20000000]of shortint;
a:real;
f,g:text;
begin
assign(f,'light.in');
reset(f);
assign(g,'light.out');
rewrite(g);
readln(f,n);
fillchar(ss,sizeof(ss),0);
for i:=1 to n do
begin readln(f,a,b);
for j:=1 to b do
begin
if tail<trunc(j*a) then tail:=trunc(j*a);
if ss[trunc(j*a)]=1 then dec(ss[trunc(j*a)])
else inc(ss[trunc(j*a)]);
end;
end;
for i:=1 to tail do
begin if ss[i]=1 then writeln(g,i);
end;
close(f);close(g);
end.