N = int(eval(input()))

str2N = bin(abs(N))[2:]

S = ''

inc = 0

for i, s in enumerate(str2N[::-1]):

  S += str((int(s) + inc) % 2)

  if N > 0:

    if i % 2 == 0:

      inc = (int(s) + inc) // 2

    else:

      inc = 1 if (int(s) + inc) else 0

  else:

    if i % 2 == 0:

      inc = 1 if (int(s) + inc) else 0

    else:

      inc = (int(s) + inc) // 2

S += str(inc)

if abs(N) > 0:

  S = S[::-1][S[::-1].find('1'):]

  if N > 0:

    if len(S) % 2 == 0:

      S = '1' + S

  else:

    if len(S) % 2 != 0:

      S = '1' + S

  print(S)

else:

  print('0')
N = int(eval(input()))

def n_ary_notation(N, n):

  if N == 0:

    return '0'

  else:

    s = ''

    while N:

      s = str(N % abs(n)) + s

      N -= N % abs(n)

      N //= n

    return s

print((n_ary_notation(N, -2)))
N = int(eval(input()))
str2N = bin(abs(N))[2:]
S = ""
inc = 0
for i, s in enumerate(str2N[::-1]):
    S += str((int(s) + inc) % 2)
    if N > 0:
        if i % 2 == 0:
            inc = (int(s) + inc) // 2
        else:
            inc = 1 if (int(s) + inc) else 0
    else:
        if i % 2 == 0:
            inc = 1 if (int(s) + inc) else 0
        else:
            inc = (int(s) + inc) // 2
S += str(inc)
if abs(N) > 0:
    S = S[::-1][S[::-1].find("1") :]
    if N > 0:
        if len(S) % 2 == 0:
            S = "1" + S
    else:
        if len(S) % 2 != 0:
            S = "1" + S
    print(S)
else:
    print("0")

N = int(eval(input()))


def n_ary_notation(N, n):
    if N == 0:
        return "0"
    else:
        s = ""
        while N:
            s = str(N % abs(n)) + s
            N -= N % abs(n)
            N //= n
        return s


print((n_ary_notation(N, -2)))

-str2N = bin(abs(N))[2:] -S = "" -inc = 0 -for i, s in enumerate(str2N[::-1]): -    S += str((int(s) + inc) % 2) -    if N > 0: -        if i % 2 == 0: -            inc = (int(s) + inc) // 2 -        else: -            inc = 1 if (int(s) + inc) else 0 + + +def n_ary_notation(N, n): +    if N == 0: +        return "0" -        if i % 2 == 0: -            inc = 1 if (int(s) + inc) else 0 -        else: -            inc = (int(s) + inc) // 2 -S += str(inc) -if abs(N) > 0: -    S = S[::-1][S[::-1].find("1") :] -    if N > 0: -        if len(S) % 2 == 0: -            S = "1" + S -    else: -        if len(S) % 2 != 0: -            S = "1" + S -    print(S) -else: -    print("0") +        s = "" +        while N: +            s = str(N % abs(n)) + s +            N -= N % abs(n) +            N //= n +        return s + + +print((n_ary_notation(N, -2)))