def m(K):return "1" if K==1 else "0" if K==0 else m(-(K-K%2)//2)+str(K%2)

print((m(int(eval(input())))))

def m(K):return str(K) if K*K==K else m(-(K-K%2)//2)+str(K%2)

print((m(int(eval(input())))))
def m(K):
    return "1" if K == 1 else "0" if K == 0 else m(-(K - K % 2) // 2) + str(K % 2)


print((m(int(eval(input())))))

def m(K):
    return str(K) if K * K == K else m(-(K - K % 2) // 2) + str(K % 2)


print((m(int(eval(input())))))

-    return "1" if K == 1 else "0" if K == 0 else m(-(K - K % 2) // 2) + str(K % 2) +    return str(K) if K * K == K else m(-(K - K % 2) // 2) + str(K % 2)