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, ""))
	}
}

C++: #include <cstdio>
#include <cctype>
#include <utility>
#include <stack>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	stack<int> s;
	for (int n; n = in(), ~n;) {
		do
			s.push(n % 4);
		while (n /= 4);
		while (!s.empty()) {
			out(s.top());
			s.pop();
		}
		outl();
	}
}

C++: // 0175
#include <iostream>
#include <vector>
using namespace std;

int main(){
	while(1){
		int n;
		cin>>n;

		if(n == -1)
			break;

		vector<int> a;
		if(n == 0)
			a.push_back(0);

		while(n != 0){
			a.push_back(n%4);
			n /= 4;
		}

		for(int i=a.size()-1;i>=0;i--)
			cout<<a[i];
		cout<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,a[100],i;
	while(1){
		scanf("%d",&n);
		if(n<0) break;
		i=0;
		while(n>3){
			a[i]=n%4;
			n/=4;
			i++;
		}
		printf("%d",n);
		for(i=i-1;i>=0;i--){
			printf("%d",a[i]);
			if(i==0) printf("\n");
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(void) {

  int n;

  int quo;
  int digit[20];

  int i,num;

  while(scanf("%d",&n)!=EOF) {

    quo=n;
    num=0;

    if(quo==0) {
      
      printf("0\n");
      continue;

    }

    while(quo>0) {

      digit[num]=quo%4;
      quo/=4;

      num++;

    }
    
    for(i=num-1;i>=0;i--) printf("%d",digit[i]);

    puts("");

  }

  return 0;

}

C++: #include<iostream>
using namespace std;
int main() {
	int z[2002], x, kai, m, bai,i;
	kai = 0;
	while (1) {
		cin >> x;
		if (x == -1) {
			goto a;
		}
		kai = kai + 1;
		bai = 1;
		z[kai] = 0;
		while (x!=0) {
			m = x % 4;
			x = (x - m)/4;
			if (bai == 1) {
				z[kai] = m;
			}else {
				z[kai] = z[kai] + m * bai;
			}
			bai = bai * 10;
		}
	}
a:;
	for (i = 1; i <= kai; i++) {
		cout << z[i] << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int i,c,w[10000];
	int n,x;
	while(1){
	c=0;
		scanf("%d",&n);
		if(n==-1) break;
			while(1){
				x=n/4;
			if(x<0) break;  
				w[c]=n%4;
				n=x;
				c++;
			}
		printf("%d",n);	
	for(i=c-1;i>=0;i--){
		printf("%d\n",w[i]);
	}
	print("\n");
	}
	return 0;
}

C++: 
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  while(1){
    cin>>n;
    if(n==-1)break;
    if(n==0){
      cout<<0<<endl;
      continue;
    }
    vi a;
    while(n){
      a.push_back(n%4);
      n/=4;
    }
    for(i=a.size()-1;i>=0;i--)
      cout<<a[i];
    cout<<endl;
  }
}

C++: #include<iostream>
using namespace std;
int main() {
	int z[2002], x, kai, m, bai,i;
	kai = 0;
	while (1) {
		cin >> x;
		if (x == -1) {
			goto a;
		}
		kai = kai + 1;
		bai = 1;
		z[kai] = 0;
		while (x!=0) {
			m = x % 4;
			x = (x - m)/4;
			if (bai == 1) {
				z[kai] = m;
			}else {
				z[kai] = z[kai] + m * bai;
			}
			bai = bai * 10;
		}
	}
a:;
	for (i = 1; i <= kai; i--) {
		cout << z[i] << endl;
	}
}

C++: #include<stdio.h>

#define N 4

void Nshinsu(int);

int main(){
  while(1){
    int n;
    scanf("%d",&n);
    if(n==-1)break;
    Nshinsu(n);
  }
  return 0;
}

void Nshinsu(int n){

  int i,y=0,b=1;

  //  for(i=0;i<100;i++){    
  while(n>0){
    y+=(n%N)*b;
    n/=N;
    b*=10;
  }

  printf("%d\n",y);
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int n;
    while (scanf("%d", &n) && n != -1) {
        string res = "";
        if (n == 0) {
            printf("0\n");
            continue;
        }
        while (n > 0) {
            res += (n % 4 + '0');
            n /= 4;
        }
        reverse(res.begin(), res.end());
        cout << res << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main() {

  int n;
  stack<int> st;
  while( cin >> n, n != -1 ) {
    while(1) {
      if( n < 4 ) {
	st.push(n);
	break;
      }
      else {
	st.push(n % 4);
	n /= 4;
      }
    }
    while( !st.empty() ) {
      int data = st.top(); st.pop();
      cout << data;
    }
    cout << endl;
  }
}

C++: #include<stdio.h>
int main(){
	int n,i,a[20];
	scanf("%d",&n);
	while(n>-1){
		if(n==0){
			printf("0");
		}
		else{
			for(i=0;n>0;i++){
				a[i]=n%4;
				n=n/4;
			}
			while(i!=0){
				i--;
				printf("%d",a[i]);
			}
		}
		puts("");
		scanf("%d",&n);
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	while(true){
		cin>>n;
		if(n==-1)
			break;
		if(n==0)
			cout<<"0"<<endl;
		else{
		int c=1024*1024;
		bool first=true;
		while(true){
			if(n/c>0){
				first=false;
				cout<<n/c;
				n%=c;
			}
			else if(first==false)
				cout<<"0";
			if(c==1)
				break;
			c/=4;
		}
		cout<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int x;
	while(cin>>x,x!=-1){
		if(x==0)cout<<"0"<<endl;
		else{
			string s="";
			for(int i=0;x>=1;i++){
				s+=x%4+"0";
				x/=4;
			}
			for(int i=s.size()-1;i>=0;i--){
				cout<<s[i];
			}
			cout<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		if(n==-1)
			break;
		vector<int> ans(0);
		do{
			ans.insert(ans.begin(),n%4);
			n=n/4;
		}
		while(n!=0);
		for(int i=0;i<ans.size();i++)
			cout << ans[i];
		cout << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  int a;
  while(cin >> a, a>=0){
    vector<int> ans;
    if(a==0)ans.push_back(0);
    while(a){
      ans.push_back( a%4 );
      a/=4;
    }
    reverse(ans.begin(),ans.end());
    for(int i=0;i<(int)ans.size();i++) cout << ans[i] << endl;
  }
}