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;

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

int main()
{
	int n;
	while(cin >> n){
		if(n == -1){
			break;
		}
		if(n==0)
			cout << 0;
		else
			yon(n);
		cout << endl;
	}
	return 0;
}

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

using namespace std;

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

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
 
  while( cin >> n ){
    if(n == -1)break;
    vector<int>ve;
    while(1){
      ve.push_back(n%4);
      n/=4;
      if(n == 0)break;
    }
    for(int i = ve.size()-1 ; i >= 0 ; i-- )cout << ve[i];
    cout << endl;
  } 
}

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


int main(){
	int n;
	while(cin>>n,~n){
		string s;
		do{
			int a=n&3;
			s+=+a+'0';
			n>>=2;
		}while(n);
		reverse(s.begin(),s.end());
		cout<<s<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
	int n,s,k;
	while(scanf("%d",&n),n>=0)
	{
		for(s=0,k=1;n;) s+=n%4*k,n/=4,k*=10;
		printf("%d\n",s);
	}
	return 0;
}

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;
      break;
    }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 <bits/stdc++.h>
using namespace std;



int main(){

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

  int ans[10]={};
  int i=0;
  while(n)ans[i++]+=n%4,n/=4;
  
  if(i==0)cout <<0;
  for(i=i-1;i>=0;i--)cout << ans[i];
  cout <<endl;
  }

  return 0;
}

C++: #include <stdio.h>

int main(void)
{
int a[100];
int n;
int index;

while (1){
scanf("%d", &n);
if (n == -1) break;
index = 0;
do {
a[index++] = (n & 0x3);
n =>> 2;
} while (n != 0);

index--;
while (index >= 0){
printf("%d", a[index--]);
}

puts("");
}
}

C++: #include<iostream>
#include<bitset>
#include<cstdio>
#include<string>
using namespace std;
int main() {
    int a[100], b[100], n, m, i, min1 = 100, min2 = 100, num;
    cin >> n;
    for (i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    cin >> m;
    for (int j = i; j < m + i; j++) {
        cin >> a[j] >> b[j];
    }
    for (int j = 0; j < n + m; j++) {
        for (int l = 0; l < n + m; l++) {
            if (min1 == a[l]) {
                if (min2 > b[l]) {
                    min1 = a[l];
                    min2 = b[l];
                    num = l;
                }
            }
            else if (min1 > a[l]) {
                min1 = a[l];
                min2 = b[l];
                num = l;
            }
        }
        cout << min1 << " ";
        printf("%02d", min2);
        cout << endl;
        a[num] = 1000;
        b[num] = 1000;
        min1 = 100;
        min2 = 100;
    }
    return 0;
}

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

long long Decimal4(long long d){
	std::vector<long long> v;
	while(d){
		v.push_back(d%4);
		d /= 4;
	}

	long long j = 1, res = 0;
	for(int i=0;i<v.size();i++){
		res += (j * v[i]);
		j *= 10;
	}

	return res;
}

int main(){
	int i;
	while(std::cin >> i, i >= 0){
		std::cout << Decimal4(i) << '\n';
	}
}

C++: #include <iostream>

using namespace std;

int main() {
    while (1) {
        int n = 0;
        int result = 0;
        
        cin >> n;
        if (n == -1) {
            break;
        }
        
        int temp = 0;
        
        for (int i = 0; n != 0; i++) {
            temp = n;
            
            n &= 3;
        
            for (int j = 0; j < i; j++) {
                n *= 10;
            }
            
            result += n;
        
            n = temp;
            
            n = n >> 2;
        }
        
        cout << result << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;
typedef long long ll;

int main(){
	int N;
	while(cin>>N,~N){
		ll ans=0;
		for(int i=0;i<N;i++){
			ans++;
			for(ll j=1; ans/j%10==4; j*=10) ans += j*6;
		}
		printf("%d\n",ans);
	}
	return 0;
}

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

int main(){
	string s;
	int n;
	while (1) {
		s = "";
		cin >> n;
		if (n == -1) break;
		for (int i = 0; n;i++) {
			char c = '0' + (n % 4);
			s = c + s;
			n /= 4;
		}
		if (s.empty()) s = "0";
		cout << s << endl;
	}
	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<iostream>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
int main(){
    int n;
    while(cin>>n,n!=-1){
        stack<int>S;
        do{
            S.push(n%4);
            n/=4;
        }while(n>0);

        while(S.size()){
            int a=S.top();S.pop();
            cout<<a;
        }
        cout<<endl;
    }
}

C++: #include <cstdio>

using namespace std;

int fromf(char c){
	if('0' <= c && c <= '9'){
		return c - '0';
	}else{
		return 10 + c - 'a';
	}
}

char tof(int i){
	if(i < 10){
		return '0' + i;
	}else{
		//printf("\n!!%d!!\n",i);
		return 'A' + (i - 10);
	}
}

int main(){
	int data;
	int self;
	char c[256];
	char ans[256];
	char *pt,*ptt;
	while(scanf("%d",&data) && data != -1){
		sprintf(c,"%x",data);
		ptt = ans;
		pt = c;
		while(*pt != '\0'){
			
			self = fromf(*pt);
			self /= 4;
			//printf("!%d->%d\n",self,self/4);
			*ptt = tof(self);
			ptt++;
			self = fromf(*pt) % 4;
			*ptt = tof(self);
			ptt++;
			pt++;
		}
		*ptt = '\0';
		ptt = ans;
		if(*ptt == '0'){
			ptt++;
		}
		printf("%s\n",ptt);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int z[2222], x, kaisuu, m, kai;
	kaisuu = 0;
	while (1) {
		cin >> x;
		if (x == -1) {
			goto a;
		}
			}
a:;
	for (int i = 1; i <= kaisuu; i++) {
		cout << z[i] << endl;
	}
}

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