program main
  implicit none
  integer :: n, i
  read(*, *) n
  do i = 30, 0, -1
    if (iand(n, ishft(1, i)) > 0) then
      write(*, "(i0)") ishft(1, i)
      exit
    end if
  end do
end program main
