object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextLong

  case class X(sum: Long, cur: Long, i: Int)
  def seq: Stream[Long] = 1L #:: seq.map(_ * -2)
  def scan(s: Stream[(Long, Int)]): Stream[X] = s.scanLeft(X(0L, 0L, 0)){
    case (x, (n, i)) => X(x.sum + n, n, i)
  }
  def minuses: Stream[X] = scan(seq.zipWithIndex.filter(_._1 < 0))
  def pluses: Stream[X] = scan(seq.zipWithIndex.filter(_._1 > 0))


  def exec(result: Long, n: Long): Long = {
    n match {
      case n if n < 0 =>
        val x = minuses.find(_.sum <= n).get
        exec(result | 1L << x.i, n - x.cur)
      case n if n > 0 =>
        val x = pluses.find(_.sum >= n).get
        exec(result | 1L << x.i, n - x.cur)
      case _ => result
    }
  }

  println(exec(0L, N).toBinaryString)
}