<>=~$";$a=($b-1+($b=$a+1))%$' for 2..$`;print$b