var a:array[0..9999]of word;i,j:word;begin repeat for j:=1to 4999do a[j]:=max(j*2,a[j+j div max(a[i],1)]);write(a[i]+1,^`);i:=i+1until i>1117end.