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 <vector>
using namespace std;

int main() {
  int n;
  vector<int> v;
  while (1) {
    cin >> n;
    if (n == -1) break;
    v.clear();
    while (n) {
      v.push_back(n%4);
      n /= 4;
    }
    if (!v.size()) {
      cout << "0" << endl;
    } else {
      for (vector<int>::reverse_iterator it=v.rbegin(); it!=v.rend(); ++it) {
        cout << *it;
      }
      cout << endl;
    }
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  while(true){
    int n;
    int num = 0;
    int ans[52];
    cin >> n;
    if(n<0)break;
    while(n>0){
      int p = n & 3;
      n >>= 2;
      //cout << p << endl;
      ans[num++]=p;
    }
    for(int i = num-1; i >= 0; --i){
      putchar('0'+ans[i]);
    }
    if(num==0)putchar('0');
    putchar('\n');
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == -1)
            return 0;
        if(n == 0){
            cout << 0 << endl;
            continue;
        }

        string ret;
        while(n > 0){
            ret += (n & 3) + '0';
            n >>= 2;
        }
        reverse(ret.begin(), ret.end());
        cout << ret << 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;
		}

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

		change.clear();
	}

	return (0);
}

C++: #include <iostream>
#include <cstdlib>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		if(n==-1)break;
		char s[20];
		itoa(n,s,4);
		cout << s << "\n";
	}
	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++: // 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 <iostream>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		if(n==-1)break;
		string s;
		string temp;
		for(int i=0;n>>i;i+=2){
			temp+=(char)((n>>i)%4)+'0';
		}
		if(temp.empty())temp="0";
		for(int i=temp.size()-1;i>=0;--i)s+=temp[i];
		cout << s << "\n";
	}
	return 0;
}

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

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

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    while(cin>>n&&n!=-1){
        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 <stdlib.h>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		if(n==-1)break;
		char s[20];
		itoa(n,s,4);
		cout << s << "\n";
	}
	return 0;
}

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

C++: #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++: #include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(void){
  int n;
  vector<int>num;

  while(cin >> n){
    if(n==0){
      cout << 0 << endl;
      continue;
    }
    for(int i=0;n>0;i++){
      num.push_back(n%4);
      n/=4;
    }
    for(int i=num.size()-1;i>=0;i--)
      cout << num[i];
    cout << endl;
    num.clear();
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

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

		vector<int> v;
		v.push_back(n%4);
		int ans = 0;
		
		for(int i=0;n>0;i++)
		{
			ans += (n%4)*pow(10,i);
			n /= 4;
		}

		cout << ans << endl;
	}
	return 0;
}