($%,$B,$_,$b)=glob<>;$_+=$%while$_%$B-$b;print