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<stdio.h>
int dat[100];
int main(){
	int a;
	while(scanf("%d",&a),~a){
		int now=0;
		if(a==0)dat[now++]=0;
		while(a){
			dat[now++]=a%4;
			a/=4;
		}
		for(int i=now-1;i>=0;i--)printf("%d",dat[i]);
		printf("\n");
	}
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	
	while(scanf("%d", &n),n != -1){
		char adic[1000];
		int i = 0;
		
		if(n == 0)printf("0\n");
		else{
		while(n > 0){
			adic[i] = n%4 + '0';
			n /= 4;
			i++;
		}
		
		reverse(adic, adic+i);
		
		printf("%s\n", adic);
		}
	}
	
	return(0);
}

C++: #include <stdio.h>    
#include <math.h>

int main()
{
	int a, b;
	int flag=0;
	int i, j;

	int m4 = (int)pow(4.0, 13);
	int c = m4;
	while (scanf("%d", &a), a != -1){
		flag = 0;
		if (a == 0) printf("0");
		else{
			c = m4;
			for (i = 0; c != 0; c /= 4){
				b = a / c;
				a %= c;
				if (b != 0){ printf("%d", b); flag = 1; }
				else{
					if (flag != 0)printf("0");
				}
			}
		}
		printf("\n");
	}
	return 0;
}

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

int main()
{
  int n;
  vector<int> v;
  vector<int>::iterator it;
  while (cin>>n, n!=(-1)) {
    v.clear();
    v.push_back(n%4);
    while (n/=4) v.push_back(n%4);
    for (it = v.end(); it != v.begin();)
      cout<<*(--it);
    cout<<endl;
  }
}

C++: #include<iostream>
using namespace std;
int box[]={0,1,2,3};
void oct(int x){
	int a=x%4;
	if(x/4!=0)
	oct(x/4);
	cout<<box[a];
}
int main(){
	int x;
	while(cin>>x,x!=-1){
		oct(x);
		cout<<endl;
	}
	return 0;
}

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

int main(){

	int n;
	vector<int> vc;
	
	while(cin >> n){
		if(n == -1) break;
		vc.clear();
		
		if(n == 0){
			cout << '0' << endl;
			continue;
		}
		
		while(1){
			if(n == 0) break;
			vc.insert(vc.begin(), n % 4);
			n = (n - n % 4) / 4;
		}
		
		for(int i=0; i<vc.size(); i++){
			cout << vc[i];
		}
		cout << endl;
	}

	return 0;

}

C++: #include<iostream>
#include<algorithm>
using namespace std;

int main()
{
  int n, i;
  char c[1000000];
  while(true)
  {
    cin >> n;
    if(n < 0)
      break;
    if(!n)
    {
      cout << 0 << endl;
      continue;
    }
    for(i = 0; n > 0; i++)
    {
      c[i] = n % 4 + '0';
      n = n / 4;
    }
    reverse(c, c + i);
    cout << c << endl;
  }
}

C++: #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define itrep(it, a) for(it = (a).begin(); it != (a).end(); it++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

string solve(int n){
    int k = 1;
    string ans;
    while(k <= n) k*=4;
    k/=4;

    if(k == 0) return "0";
    while(k != 0){
        int a = n / k;
        ans+=a + '0';
        n%=k;
        k/=4;
    }
    return ans;
}

int main(){
    int n;
    while(cin >> n, n != -1){
        cout << solve(n) << endl;
    }
}

C++: #include<functional>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<string>
#include<math.h>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
using namespace std;
const int INF=100000000;
int main(){
  int n;
  while(cin>>n,n!=-1){
    vector<int> a;
    if(n<4)cout<<n<<endl;
    else{
      for(int i=0; ;i++){
	int amari=n%4;
	a.push_back(amari);
	int b=n;
	n=n/4;
	if(n<4&&n!=0){
	  a.push_back(n);
	  break;
	}
      }
    }
    for(int i=a.size()-1;i>=0;i--){
      cout<<a[i];
    }
    cout<<endl;
  }
  return 0;
}

C++: //13
#include<iostream>
#include<string>

using namespace std;

int main(){
  for(int n;cin>>n,n!=-1;){
    string s;
    do{
      s+=char(n%4+'0');
      n/=4;
    }while(n);
    cout<<string(s.rbegin(),s.rend())<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    while(cin >> n, ~n){
        string ans;
        while(n){
            ans += to_string(n&3);
            n >>= 2;
        }
        if(ans.empty()) ans = "0";
        reverse(ans.begin(),ans.end());
        cout << ans << "\n";
    }
    return 0;
}

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++){    
    y+=(n%N)*b;
    n/=N;
    b*=10;
  }

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

C++: #include<iostream>
#include<cmath>
using namespace std;
int a, b[20], ok;
int main() {
	while (true) {
		ok = 0;
		cin >> a;
		if (a == -1) { break; }
		for (int i = 0; i < 15; i++) {
			b[i] = (a / (int)pow(4, i)) % 4;
		}
		for (int i = 14; i >= 0; i--) {
			if (b[i] >= 1) { ok = 1; }
			if (ok == 1 || i == 0) {
				cout << b[i];
			}
		}
		cout << endl;
	}
}

C++: #include <iostream>
#include <stack>
using namespace std;

int main()
{

	int n;
	stack< int > out;

	while( true ) {

		cin >> n;
		if( n == -1 ) break;
		do {
			
			out.push( n % 4 ); n /= 4;

		} while( n );

		while( !out.empty() ) { cout << out.top(); out.pop(); }

		cout << endl;

	}

	return 0;

}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    while(cin>>n){
        if(n==-1){
            break;
        }
        int ans=0;
        for(int i=0;;i++){
            ans+=(n%4*pow(10,i));
            if(n/4==0) break;
            n=n/4;
            
        }
        
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){

    int x;
    while(cin>>x,x!=-1){
        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 <vector>

using namespace std;

int main()
{
	int n;
	vector<int> result;
	
	while (cin >> n, n != -1){
		while (1){
			result.push_back(n % 4);
			n /= 4;
			if (n == 0){
				break;
			}
		}
		for (int i = result.size() - 1; i >= 0; i--){
			cout << result[i];
		}
		cout << endl;
		result.clear();
	}
	return (0);
}

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

int main(){
	int n;
	while(scanf("%d",&n), n != -1){
		if(n == 0){
			printf("0\n");
			continue;
		}
		stack<int> st = stack<int>();
		while(n != 0){
			int r = n % 4;
			n /= 4;
			st.push(r);
		}
		while(!st.empty()){
			printf("%d",st.top());
			st.pop();
		}
		printf("\n");
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n&&n!=-1){
		string ans;
		for(;n>0;n/=4)ans+=n%4+'0';
		if(ans.size()==0)cout<<0;
		else for(int i=ans.size()-1;i>=0;i--)cout<<ans[i];
		cout<<endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
long n,i;
string s;
while(cin>>n){
if(n==-1)break;
s="";

for(i=0;;i++){
s+=n%4+48;
n/=4;
if(n==0)break;
}
for(i=s.size()-1;i>=0;i--)cout<<s[i];
cout<<endl;
}
return 0;
}