
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iomanip>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,n) for(int i=a; i<n; i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int p[15];

int main()
{
	int w;
	cin >> w;

	int sum = 0;
	rep(i, 15) {
		sum += pow(3, i);
		p[i] = sum;
	}
	
	int n = 14,sign = 1;
	bool f = false;
	while (n >= 0) {
		int bob = pow(3, n);
		int diff;
		if (w > 0)
			diff = w - bob;
		else
			diff = w + bob;
		if (abs(diff) < abs(w)) {
			f = true;
			if (sign == 1 )cout << "+";
			else if (sign == -1)cout << "-";
			if (w >= 0) {
				w -= bob;
			}
			else {
				w += bob;
			}	
			if (w < 0)sign = -1;
			else sign = 1;
		}
		else if (f)cout << "0";
		n--;
	}
	cout << endl;
	return 0; 
}