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>
#include <algorithm>

using namespace std;
 
int main()
{
    int n;
    string str;
    while (cin >> n , n != -1) {
	str = "";
	if (!n) cout << '0' << endl;
	else {
	    while (n) {
		str += n % 4 + '0';
		n /= 4;
	    }
	    reverse(str.begin(), str.end());
	    cout << str << endl;
	}
    }
    return 0;
}

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

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

C++: #include<stdio.h>
int main(void)
{
	long long int a,b,c,i;
	scanf("%lld",&a);
	b=0; c=0;
	for(i=0;i<a;i++){
		c++;
		b++;
		if(c==4){
			c=0;
			b=b/10*10+10;
		}
	}
	printf("%lld",b);
	return 0;
}

C++: // 2011/01/31 Tazoe

#include <iostream>
using namespace std;

void print4(int n)
{
	if(n/4!=0)
		print4(n/4);

	cout << n%4;
}

int main()
{
	while(true){
		int n;
		cin >> n;
		if(n==-1)
			break;

		print4(n);
		cout << endl;
	}

	return 0;
}

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){
   
    while(true){
        int t; cin>>t;
        if(t==-1)break;
        string res;
        while(t!=0){
            res=(char)(t%4+'0')+res;;
            t/=4;
        }
        cout<<res<<endl;
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

const int RADIX = 4;

void transfer(int n) {
	string Result;

	do {
		Result += n % RADIX + '0';
		n /= RADIX;
	} while (n);

	reverse(Result.begin(), Result.end());
	cout << Result << endl;
}

int main() {
	int n;
	
	while (cin >> n, n != -1) {
		transfer(n);
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
#include<algorithm>
#define REP(i,a) for(int  i=0;i<a;i++)
int main(){


	int a,b=0,c,A[100000],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>
using namespace std;
int main(void){
    
    //変数：10進数｢ tenNumber ｣, ４進数｢ foueNumber ｣と置く
    int tenNumber, foueNumber[1000000];
    
    //繰り返し：10進数｢ tenNumber ｣の値が｢ -1 ｣になるまで繰り返し
    while(cin >> tenNumber, tenNumber != -1){
        
        //変数：余りの個数｢ count ｣と置く
        int count = 0;
        
        //繰り返し：余りを求める繰り返し
        while(1){
            
            //計算：余りと商を求めている
            foueNumber[count] = tenNumber % 4;
            tenNumber /= 4;
            
            //条件：余りが無かったら終了
            if(tenNumber == 0) break;
            
            //計算：上の計算より余りがまだあるので余りの数が１個足す
            count++;
        }
        
        //出力：配列の逆から表示する　⇒　ポイント：余りは逆から表示する
        for(int i = count; i >= 0; i--){
            cout << foueNumber[i] << ( (i != 0) ? "" : "\n" );
        }
    }
    
}

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

int main()
{
	int n;

	cin >> n;

	while (n != -1) {
		string s;

		if (n == 0)
			s = "0";

		while (n > 0) {
			s = to_string(n % 4) + s;
			n /= 4;
		}

		cout << s << endl;
		
		cin >> n;
	}

	return 0;
}

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

int main()
{   
    int n;
    string s;

    while( cin >> n )
    {
        if( n == -1 )
            break;
        else if( n == 0 )
            cout << 0 << endl;
        else
        {
            s = "";
            while( n != 0 )
            {
                s += n % 4 + '0';
                n /= 4;
            }
            for( int i = s.size() - 1; i >= 0; i-- )
                cout << s[i];
            
            cout << endl;
        }
    }

    return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vpii> vvpii;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n;
  while (cin >> n, n != -1) {
    string s = "";
    if (!n) {
      cout << 0 << endl;
      continue;
    }
    while (n) {
      s = string(1, '0' + n % 4) + s;
      n /= 4;
    }
    cout << s << endl;
  }
}

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

int main() {
  int n;
  while (cin >> n, n != -1) {
    string s;
    while (n) {
      int t = n % 4;
      s = to_string(t) + s;
      n /= 4;
    }
    cout << (s.size() ? s : "0") << "\n";
  }
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n;
	int temp;
	int a[1000];
	int cnt = 0;
	while (cin >> n){
		if (n == -1) break;
		while (n > 0){
			temp = n % 4;
			a[cnt] = temp;
			n /= 4;
			cnt++;
		}
		if (cnt == 0) cout << "0" << endl;
		for (int i = cnt - 1; i >= 0; i--) {
			cout << a[i];
			if (i == 0) cout << endl;
		}
		cnt = 0;
	}
	return 0;
}