while 1:

  a = eval(input())

  if a<0: break

  x=[]

  while a:

    x.append(str(a % 4))

    a/=4

  if x==[]: x="0"

  print("".join(x[::-1]))
while 1:

  a = eval(input())

  if a<0: break

  x=''

  while a:

    x = str(a % 4)+x

    a/=4

  print([x,'0'][x==''])
while 1:
    a = eval(input())
    if a < 0:
        break
    x = []
    while a:
        x.append(str(a % 4))
        a /= 4
    if x == []:
        x = "0"
    print("".join(x[::-1]))

while 1:
    a = eval(input())
    if a < 0:
        break
    x = ""
    while a:
        x = str(a % 4) + x
        a /= 4
    print([x, "0"][x == ""])

-    x = [] +    x = "" -        x.append(str(a % 4)) +        x = str(a % 4) + x -    if x == []: -        x = "0" -    print("".join(x[::-1])) +    print([x, "0"][x == ""])