Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == -1 {
			break
		}
		if n == 0 {
			fmt.Println(0)
			continue
		}
		ans := make([]int, 0)
		for n > 0 {
			ans = append([]int{n % 4}, ans...)
			n = n / 4
		}

		buf := make([]string, len(ans))
		for i := range ans {
			buf[i] = strconv.Itoa(ans[i])
		}
		fmt.Println(strings.Join(buf, ""))
	}
}

Python: import sys
import math
def four_number(n,sum1,keta):
    ans=n//4
    amr=n%4
    sum1=sum1+amr*(math.pow(10,keta))
    keta=keta+1
    if(ans==0):
        return sum1
    else:
        return four_number(ans,sum1,keta)
        
    
i=0
sum1=0
keta=0
while i<2000:
    n=int(input())
    if(n==-1):
        break
    after_number=four_number(n,sum1,keta)
    print(round(after_number))

Python: while True:
    a = int(input())
    if a == -1:
        break
    ans = []
    if a == 0:
        print(0)
    else:
        while a != 0:
            ans.append(a%4)
            a //= 4
        ans = list(map(str,ans))
        print("".join(ans[::-1]))

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

Python: import sys
def main():
    for line in sys.stdin:
        n = int(line)
        if n == -1:
            break
        else:
            if n != 0:
                hoge = []
                while True:
                    foo = n // 4
                    bar = n % 4
                    if foo >= 4:
                        hoge.append(bar)
                        n = foo
                    elif foo < 4:
                        hoge.append(bar)
                        hoge.append(foo)
                        break
                hoge.reverse()
                hoge = [str(hoge[i]) for i in range(len(hoge))]
                fuga = ""
                for i in range(len(hoge)):
                    fuga += hoge[i]
                print(int(fuga))
            elif n == 0:
                print(n)



if __name__ == "__main__":
    main()

Python: while True:
    n = int(input())
    if n == -1:
        break
    if n == 0:
        print(0)
    else:
        ans = []

        while n > 0:
            ans.append(n % 4)
            n = n // 4

        for i in range(len(ans)):
            print(ans[len(ans) - 1 - i], end="")
        print("")

Python: # Aizu Problem 00175: Quaternary Notation
#
import sys, math, os, bisect

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

VALUES = {chr(65+i): 10+i for i in range(26)}
for i in range(10):
    VALUES[str(i)] = i
INV_VALUES = {value: key for key, value in VALUES.items()}

POWERS = {(base, power): base**power for base in range(1, 37) for power in range(200)}

def from_base(k, base_k):
    # convert integer k in base base_k to decimal (base 10)
    L = len(k)
    res = 0
    for i in range(L - 1, -1, -1):
        res += VALUES[k[i]] * POWERS[(base_k, L - 1 - i)]
    return res

def to_base(d, to_base):
    if d == 0:
        return 0
    # convert decimal integer (base 10) to base base_k
    res = ""
    for p in range(50, -1, -1):
        power = POWERS[(to_base, p)]
        m = d // power
        res += INV_VALUES[m]
        d = d % power
    while res[0] == '0':
        res = res[1:]
    return res


while True:
    n = int(input())
    if n == -1:
        break
    print(to_base(n, 4))

Python: BASE = 4

while True:

    input_num = int(input())

    if input_num == -1:
        break

    result = ""

    while True:
        quotient, remainder = divmod(input_num, BASE)

        result = str(remainder) + result

        if input_num < BASE:
            break

        input_num = quotient

    print(result)

Python: import math
while 1:
    n = int(input())
    if n == -1:
        break
    elif n == 0:
        print(0)
    else:
        p = int(math.log(n,4))

        l =[None for i in range(p)]
        x = n
        for i in range(p):
            l[i] = x // (4 ** (p - i))
            x = x % (4 ** (p - i))
        l.append(x)

        print(*l,sep="")

Python: import sys
def main():
    for line in sys.stdin:
        n = int(line)
        if n == -1:
            break
        else:
            if n != 0:
                hoge = []
                while True:
                    foo = n // 4
                    bar = n % 4
                    if foo >= 4:
                        hoge.append(bar)
                        n = foo
                    elif foo < 4:
                        hoge.append(bar)
                        hoge.append(foo)
                        break
                hoge.reverse()
                hoge = [str(hoge[i]) for i in range(len(hoge))]
                fuga = ""
                for i in range(len(hoge)):
                    fuga += hoge[i]
                print(fuga)
            elif n == 0:
                print(n)



if __name__ == "__main__":
    main()

Python: def translate(x):
    if int(x/4):
        return translate(int(x/4)) + str(x % 4)
    return str(x % 4)


while 1:
    n = int(input())
    if n == -1:
        break

    n4 = translate(n)
    print(n4)

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

Python: import sys
def main():
    ds = []
    for line in sys.stdin:
        n = int(line)
        if n != -1:
            ds.append(n) #data set
        elif n == -1:
            for i in range(len(ds)):
                if ds[i] != 0:
                    hoge = []
                    p = ds[i]
                    while True:
                        foo = p // 4
                        bar = p % 4
                        if foo >= 4:
                            hoge.append(bar)
                            p = foo
                        elif foo < 4:
                            hoge.append(bar)
                            hoge.append(foo)
                            break
                    hoge.reverse()
                    hoge = [str(hoge[i]) for i in range(len(hoge))]
                    fuga = ""
                    for j in range(len(hoge)):
                        fuga += hoge[j]
                    print(fuga)
                elif ds[i] == 0:
                    print(0)
            else:
                    break

if __name__ == "__main__":
    main()

Python: while 1:
    a=int(input())
    if a<0:break
    ans='' if a!=0 else '0'
    while a:ans,a=str(a%4)+ans,a//4
    print(ans)

Python: # AOJ 0175 Quaternary Notation
# Python3 2018.6.19 bal4u

while True:
	n = int(input())
	if n < 0: break
	if n == 0: print(0)
	else:
		ans = []
		while n > 0:
			ans.append(str(n & 3))
			n >>= 2
		print(*ans[::-1], sep='')

Python: import math
while 1:
    n = int(input())
    if n == -1:
        break
    elif n == 0:
        print(0)
    else:
        p = int(math.log(n,4))

        l =[None for i in range(p)]
        x = n
        for i in range(p):
            l[i] = x // (4 ** (p - i))
            x = x % (4 ** (p - i))
        l.append(x)

        print(*l,sep="")

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0175

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    while True:
        n = int(input())
        if n == -1:
            break

        q = []
        q.append(n % 4)
        while n > 3:
            n //= 4
            q.append(n % 4)

        q.reverse()
        print(''.join(map(str, q)))


if __name__ == '__main__':
    main(sys.argv[1:])