\newcount\m\newcount\i\m=100\loop\ifnum\i<50\read0to\a\immediate\write1{\ifnum\a<\m1\else0\fi}\ifnum\a<\m\m=\a\fi\advance\i1\repeat\end