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<iostream>
using namespace std;
#include<algorithm>
#define REP(i,a) for(int  i=a-1;i>=0;i--)
int A[100000];
int main(){


	int a,b=0,c,n,j,k;	
	cin>>n;
	while(n!=-1){
	a=n;
		while(1){
			if(a<4) {
				A[b]=a;
				break;
			}
			A[b]=a%4;
			a=a/4; 
			b++;
		}
		REP(i,b+1){
			cout<<A[i];

		}
		cout<<endl;
		b=0;
		cin>>n;
	}
	return 0;
}

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

int main(void){
	int num;
	while(cin>>num,num!=-1){
		vector<int> ans;
		while(num>0){
			ans.push_back(num%4);
			num/=4;
		}
		for(int i = ans.size()-1 ;  i >= 0 ; i --){
			cout<<ans[i];
		}
		cout<<endl;
		
	}
}

C++: #include <iostream>
#include <stack>
using namespace std;
int main(){
	stack<int> a;
	int n;
	while(cin>>n && n!=-1){
		if(n==0)a.push(0);
		while(n){
			a.push(n%4);
			n/=4;
		}
		while(a.empty() != true){
			cout<<a.top();
			a.pop();
		}
		cout<<endl;
	}
	return 0;
}

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

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

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

int main() {

    long int n;

    while(1){

        scanf(" %ld",&n);

        if(n==-1){
            break;
        }

        vector<int> v;

        while(n!=0){

            v.push_back(n%4);

            n /= 4;

        }

        reverse(v.begin(),v.end());

        for(int i=0;i<v.size();i++){
            cout << v[i];
        }

        cout << '\n';

    }

    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&&n>=0){
        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 <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	while(1){
		cin>>n;
		if(n==-1)break;
		int i=10,ans=n%4;
		n/=4;
		while(n>0){
			ans+=n%4*i;
			i*=10;n/=4;
		}
		cout<<ans<<endl;
	}
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
using namespace std;
int main(){
	
	
	int n;
	
	
	while(cin>>n,n!=-1){
		string s="";
		for(int k=9;k>=0;k--){
			int i=int(pow(4,k));
			int count=0;
			for(int j=0;j<3;j++){
				if(n-i>=0){
					n=n-i;
					count++;
				}
				else
					break;
			}
			s=s+to_string(count);
			
		}
		
		cout<<stoi(s)<<endl;
	}
			

}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	while(1){
		int n,a=0,f=0;
		cin>>n;
		if(n==-1) break;
		if(n==0){
			cout<<0<<endl; continue;
		}
		string s;
		rep(i,0,10){
			a=n/(int)pow(4,9-i);
			n%=(int)pow(4,9-i);
			if(a){
				cout<<a; f=1;
			}
			else if(a==0&&f==1) cout<<0;
			if(i==9) cout<<endl;
		}
	}
}

C++: #include <iostream>

using namespace std;

int main(void){

  int n;
  while( cin >> n , n >= 0  ){

    int I = 0;
    int N[1000000];
    while( n >= 4 ){
      N[I++] = n % 4;
      n /= 4;
    }
    N[I++] = n;
    for( int i = I - 1 ; i >= 0 ; i-- ) cout << N[i];
    cout << endl;

  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair
#define PB push_back

main(){
  int n;
  while(cin>>n,~n){
    string str;
    if(n==0)str+='0';
    while(n){
      str+=n%4+'0';
      n/=4;
    }
    reverse(str.begin(),str.end());
    cout<<str<<endl;
  }
}

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

string four(int n){
	string ret;
	while(n){
		ret += (char)(n%4+'0');
		n/=4;
	}
	reverse(ret.begin(),ret.end());
	return ret;
}

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

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

int main()
{
	int n;
	vector<int> change;

	while (cin >> n, n != -1){
		while (1){
			change.push_back(n % 4);
			if (n / 4 == 0){
				break;
			}
			n /= 4;
		}
		reverse(change.begin(), change.end());

		for (int i = 0; i < change.size(); i++){
			cout << change[i];
		}
		cout << endl;

		change.clear();
	}

	return (0);
}

C++: #include <iostream>

using namespace std;

void saiki( int n ){
	int a = n % 4;
	if( n == 0 ) return;
	saiki( n / 4 );
	cout << a;
}

int main(int argc, char const* argv[])
{
	int n;

	while( cin >> n && n != -1 ){
		if( n == 0 ) cout << 0;
		else saiki( n );
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stack>
#include<cstdio>
#include<map>
#include<functional>
#include <sstream>

using namespace std;

string ans;

string IntToString(int number)
{
    stringstream ss;
    ss << number;
    return ss.str();
}


string sinsuu(int n){
    ans += IntToString(n%4);
    if (n==0){
        ans="0";
        return ans;
    }
    else if( (n/4) < 4 ){
        if ( (n/4) > 0 ) {
            ans += IntToString(n/4);
        }
        reverse( ans.begin(), ans.end());
        return ans;
    }
    else{
        n = n/4;
        return sinsuu(n);
    }
}

int main(){
	int n;
    while (1)
    {
        cin>>n;
        if(n<0)break;
        cout<<sinsuu(n)<<endl;
        ans.clear();
        
    }
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 1000000000;
using namespace std;

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

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

int main()
{
	int n;
	
	while(scanf("%d", &n),n != -1){
		char adic[1000] = {0};
		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);
}