fun main(args: Array<String>) {
    var n = readLine()!!.toInt()
    if (n == 0) {
        println(0)
        return
    }
    val bin = arrayListOf<Char>()
    var i = 1
    while (n != 0) {
        if (n % 2 == 0) {
            bin += '0'
            n /= 2
        } else {
            bin += '1'
            n = (n + if (i % 2 == 0) 1 else -1) / 2
        }
        i++
    }
    bin.reversed().forEach(::print)
    println()
}
