n := read ();
while n > 0 do
if n < 1000
then
if n < 500
if n < 250
if n < 125
if n < 63
if n < 32
write (1)
fi
fi;
n := n - 1
od