#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include <cmath>
#include <queue>
#include<stack>
#include<utility>
#include<algorithm>
using namespace std;
int main(){
	int n,ans;
	while(cin>>n){
		if(n==-1)break;
		if(n<4){
			cout<<n<<endl;
		}else{
			cout<<n/4<<n%4<<endl;
		}
	}
	return 0;
}