{ this program prints a number in binary }

var
  power_of_2 : integer;
  number_converted : integer;

begin
  { read a number that is non-negative }
  readln(number_converted);

  { start with the largest power of 2, 
    compare and subtract }
  power_of_2 := 16384;

  {
    each iteration does the following:
      compare the number being converted with a power of 2
        if the result is larger than or equal to
          print 1
          subtract the power of two from the number being converted
        if the result is smaller
          print 0
        we divide the power of 2 by 2

    we need at least one iteration: use repeat-until

    we exit the loop when the utilized power of 2 is 1: we exit when
       the power of 2 becomes 0

  }
  repeat
    if number_converted >= power_of_2 then
      begin
        write('1');
        number_converted := number_converted - power_of_2
      end
    else
      begin
        write('0')
      end;
    power_of_2 := power_of_2 div 2
  until power_of_2 = 0;
  writeln;
end.

